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

move up through directories faster (set in your /etc/profile or .bash_profile)
You can also remove the "&& pwd" if you don't want it to print out each directory as it moves up.

Use tee to process a pipe with two or more processes
Tee can be used to split a pipe into multiple streams for one or more process to work it. You can add more " >()" for even more fun.

Chrome sucks
How much memory is chrome sucking?

Block all IP addresses and domains that have attempted brute force SSH login to computer
Searches all log files (including archived bzip2 files) for invalid user and PAM authentication errors, both of which are indicative of brute force attempts at logging into computer. A list of all unique IP addresses and domain names is appended to hosts.deny. The command (and grep error messages) will work on Mac OS X 10.6, small adjustments may be needed for other OSs.

Send an email from the terminal when job finishes
Might as well include the status code it exited with so you know right away if it failed or not.

Calculate N!
Same as the seq/bc solution but without bc.

Search some text from all files inside a directory

Get a file from SharePoint with cURL
If you know the URL of a file on a SharePoint server, it's just a matter of logging in with your AD credentials to get the file with cURL

View non-printing characters with cat
Useful to detect number of tabs in an empty line, DOS newline (carriage return + newline). A tool that can help you understand why your parsing is not working.

Find pages returning 404 errors in apache logs
Finds the top ten pages returning an http response code of 404 in an apache log.


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: