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

Netcat & Tar
Create a tarball on the client and send it across the network with netcat on port 1234 where its extracted on the server in the current directory.

Runs previous command replacing foo by bar every time that foo appears
To replace foo by bar, but not execute, do ^foo^bar^:p To replace all foo by bar, but not execute, do ^foo^bar^:&:p

Multiline Search/Replace with Perl
from http://stackoverflow.com/questions/1030787/multiline-search-replace-with-perl added greedy trick in wildcard match (.*?) from http://www.troubleshooters.com/codecorn/littperl/perlreg.htm#Greedy

creating you're logging function for your script
You could also pipe to logger.

Validate date, also a date within a leap year
Important to know: a valid date will return 0, otherwise 1!

create a backup for all directories from current dir
Create backup (.tar.gz) for all first-level directory from current dir.

Transcode .flac to .wav with gstreamer
Takes all .flac directories, feeds them into a simple transcode pipeline to spit out .wavs with the same name (but correct extension).

bash pause command
Waiting for a key stroke. You can use this with a ";" behind to build a command chain.

Rename files in batch

Check your spelling
For when you need a quick spell check.


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: