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

save your current environment as a bunch of defaults

Screenshot Directly To Clipboard
This will take a screenshot of a selected area and save it as foo.png as well as sending it straight to the clipboard for pasting into GIMP, Anki, Zim, etc.

check the status of 'dd' in progress (OS X)
"killall -USR1 dd" does not work in OS X for me. However, sending INFO instead of USR1 works.

Monitoring sessions that arrive at your server

shortcut to scp a file to the same location on a remote machine
This will copy a file from your current directory to the same location on another machine. Handy for configuring ha, copying your resolv.conf, .bashrc, anything in /usr/local, etc.

Show linux kernel modules dependencies
Use modprobe to list all the dependencies of a certain kernel module. Handy when debugging system issues.

Quickly graph a list of numbers
Useful when you've produced a large file of numbers, and want to quickly see the distribution. The value of y halfway along the x axis is the median. Simple! Just create the listOfNumbers.txt file with a number on each line to try it out.

See a full last history by expanding logrotated wtmp files
When your wtmp files are being logrotated, here's an easy way to unpack them all on the fly to see more than a week in the past. The rm is the primitive way to prevent symlink prediction attack.

See entire packet payload using tcpdump.
This command will show you the entire payload of a packet. The final "s" increases the snaplength, grabbing the whole packet.

Determine space taken by files of certain type
Just how much space are those zillions of database logs taking up ? How much will you gain on a compression rate of say 80% ? This little line gives you a good start for your calculations.


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: