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

Delete all flash cookies.
Maybe you want first check which files will be deleted: $ find $HOME -name '*.sol' -exec echo rm {} \;

du and sort to find the biggest directories in defined filesystem
This command give a human readable result without messing up the sorting.

df without line wrap on long FS name

Streaming HTML5 video to icecast server using dvgrab, ffmpeg2theora and oggfwd
Streaming HTML5 compatible video (Ogg Theora video with Vorbis sound) to an Icecast server using dvgrab, ffmpeg2theora and oggfwd. In this example I'm merging stereo sound to mono (-c 1), saving the original dv for later higher quality on-demand video (tee dvstream.dv), saving the theora stream for immediate on-demand video, and publishing the stream in Xiph's stream directory (-p and the name and description). The URL of the video will be (depending on your server) http://my.icecastserver.com/stream.ogv which will play in newer Firefox, Chrome and Opera web browsers. Cortado (a Java player) can easily be used for IE. Note also that I'm using port 80, which is not the default port for Icecast, this is to avoid restrictive firewalls. Also note that ffmpeg2theora 0.25 and will heed the bitrates much better than former versions because of using libtheora 1.1 or newer.

Check if port is open on remote machine
Check if port is open, if you don't have ncat on your machine.

Display ncurses based network monitor
Nload is part of nload package, tested under Debian. Nload display network bandwidth statistics, -u m options stands for MBit unit measure.

List all packages in Ubuntu/Debian that no package depends on

run a command whenever a file is touched
This is useful if you'd like to see the output of a script while you edit it. Each time you save the file the command is executed. I thought for sure something like this already exists - and it probably does. I'm on an older system and tend to be missing some useful things. Examples: $ ontouchdo yourscript 'clear; yourscript somefiletoparse' Edit yourscript in a separate window and see new results each time you save. $ ontouchdo crufty.html 'clear; xmllint --noout crufty.html 2>&1 | head' Keep editing krufty.html until the xmllint window is empty. Note: Mac/bsd users should use stat -f%m. If you don't have stat, you can use perl -e '$f=shift; @s=stat($f); print "$s[9]\n";' $1

Create a system overview dashboard on F12 key
Command binds a set of commands to the F12 key. Feel free to alter the dashboard according to your own needs. How to find the key codes? Type $ read Then press the desired key (example: F5) $ ^[[15~ Try $ bind '"\e[15~"':"\"ssh su@ip-address\C-m""" or $ bind '"\e[16~"':"\"apachectl -k restart\C-m"""

check open ports without netstat or lsof


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: