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 a BOFH excuse
Almost same output with fewer typing... OP had a great idea : BOFH !!!

Compare a remote file with a local file

Traceroute w/TCP to get through firewalls.
man tcptraceroute

Watching Command
If you need to keep an eye on a command whose output is changing, use the watch command. For example, to keep an eye on your load average

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

The Chronic: run a command every N seconds in the background
Chronic Bash function: $ chronic 3600 time # Print the time in your shell every hour $ chronic 60 updatedb > /dev/null # update slocate every minute Note: use 'jobs' to list background tasks and fg/bg to take control of them.

Do a command but skip recording it in the bash command history
Note the extra space before the command (I had to put it as an underscore since the website eats up preceding spaces). That's all it takes. Now if you check your history with "$ history", it wont show up.

Finding all files on local file system with SUID and SGID set

Watch postgresql calls from your application on localhost
It's certainly not nicely formatted SQL, but you can see the SQL in there...

Create a 5 MB blank file
Useful for testing purposes


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: