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

Colored diff ( via vim ) on 2 remotes files on your local computer.
You can use $ vim scp://root@example.com//file too in a simple case.

Rename files in batch

easily strace all your apache processes
This one-liner will use strace to attach to all of the currently running apache processes output and piped from the initial "ps auxw" command into some awk.

Check host port access using only Bash:

Download Entire YouTube Channel - all of a user's videos
create the function then run 'yt-chanrip username' to download that user's entire channel. uses youtube-dl and the GData API. similar to http://www.commandlinefu.com/commands/view/3154/download-youtube-playlist

Restore a local drive from the image on remote host via ssh

Find recursively, from current directory down, files and directories whose names contain single or multiple whitespaces and replace each such occurrence with a single underscore.
Note the g for global in the perl expression; without it, only the first occurrence in the name would be replaced.

Randomize lines in a file
This appends a random number as a first filed of all lines in SOMEFILE then sorts by the first column and finally cuts of the random numbers.

Get a regular updated list of zombies
Shows all those processes; useful when building some massively forking script that could lead to zombies when you don't have your waitpid()'s done just right.

Find ASCII files and extract IP addresses


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: