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

wget with resume
I couldn't find this on the site and it's a useful switch. Great for large files.

Fire CMD every time FILE (or directory) is updated (on *BSD)

Leap year calculation

find all active IP addresses in a network
You send a unicast ICMP packet to each host. Many firewalls will drop that ICMP. However, in order to send the ICMP, you'll have first done an ARP request and the remote machine is unlikely to ignore that, so the computer will be in your ARP table.

Print github url for the current url
Works for repos cloned via ssh or https.

Dump and bz2compress a mysql db
To also move the db backup to another location you could pass the output to the dd command instead of a file $mysqldump -u user -h host -ppwd -B dbname | bzip2 -zc9 | dd ssh usr@server "dd of=db_dump"

Perpetual calendar
Gets any date since today. Other examples of recognized expressions are "2 years 4 days ago", "7 months" (in the future), "next Sunday", "yesterday", "tomorrow", etc.

Record live sound in Vorbis (eg for bootlegs or to take audio notes)
This will record the capture channel of your soundcard, directly encoded in Ogg Vorbis, in stereo at quality 5 (I'm using this to record live jam sessions from my line input). You can choose which device to capture (eg. line input, microphone or PCM output) with $ alsamixer -V capture You can do the same thing and live encode in MP3 or FLAC if you wish, just check FLAC and LAME man pages.

Create a mirror of a local folder, on a remote server
Create a exact mirror of the local folder "/root/files", on remote server 'remote_server' using SSH command (listening on port 22) (all files & folders on destination server/folder will be deleted)

Install pip with Proxy
Installs pip packages defining a proxy


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: