All commands (14,187)

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands


Check These Out

Remove orphaned dependencies on Arch
-Qdt Lists dependencies/packages which are no longer required by any packages -q Output only package name (not the version number) -R Remove package(s) Rest is self-explanatory. I just started out with Arch - so if there is any better/standard method to achieve the same - please suggest.

Get the current svn branch/tag (Good for PS1/PROMPT_COMMAND cases)
uses just one sed

Print stack trace of a core file without needing to enter gdb interactively
The pstack command prints a stack trace of running processes without needing to attach a debugger, but what about core files? The answer, of course, is to use this command. Usage: gdbbt program corefile

Isolate file name from full path/find output
Quick method of isolating filenames from a full path using expansion. Much quicker than using "basename"

Show memory stats on Nexenta/Solaris

Recursively find disk usage, sort, and make human readable (for systems without human-readable sort command)
Recursively find disk usage, sort, and make human readable: * For systems without human-readable sort command * awk, not perl

find available cpu frequencies on FreeBSD
Once you know the available frequencies for your CPU, they can be used to do things like set minimum CPU frequency for powerd so that it doesn't ramp down too slow on a server : /etc/sysctl.conf or /boot/loader.conf: debug.cpufreq.lowest=DESIRED FREQ HERE or at terminal sysctl debug.cpufreq.lowest=DESIRED FREQ HERE

Redirect STDIN
Several times, I find myself hitting my up arrow, and changing the search term. Unfortunately, I find myself wasting too much time typing: $ grep kernel /var/log/messages Redirecting STDIN allows me to put the search term at the end so I less cursor movement to change what I'm searching for: $ < /var/log/messages grep kernel If you're using the emacs keyboard binding, then after you press your up arrow, press CTRL+w to erase the word. If this has already been submitted, I couldn't find it with the search utility.

Calculate days on which Friday the 13th occurs
I removed the dependency of the English language

Go to parent directory of filename edited in last command


Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: