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

Get your public ip

Lvextend logical volume
this command extends your logical volume. then it does a resize2fs on it as well. added the -r switch to make it launch resize.

Recursive replace of directory and file names in the current directory.
This should work anywhere perl and grep is available. :P

execute a command in case of success or execute a command in case of failure

SSH to a machine's internet address if it is not present on your local network
Ping machine once, waiting 1 second for response until failing. Upon fail, ssh globally, otherwise ssh locally.

Kill XMMS for a cron job

Substitute spaces in filename with underscore
Substitute spaces in filename with underscore, it work on the first space encountered.

Console clock
Turn your terminal into digital clock.

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.

IFS - use entire lines in your for cycles
When you use a "for" construct, it cycles on every word. If you want to cycle on a line-by-line basis (and, well, you can't use xargs -n1 :D), you can set the IFS variable to .


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: