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

print crontab entries for all the users that actually have a crontab
This is how I list the crontab for all the users on a given system that actually have a crontab. You could wrap it with a function block and place it in your .profile or .bashrc for quick access. There's prolly a simpler way to do this. Discuss.

Remove the first character of each line in a file

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

yes > /dev/null
your laptop can be a good heater :)

Switch to the previous branch used in git(1)
Very useful if you keep switching between the same two branches all the time.

Make directory including intermediate directories
This will create the intermediate directories that do not exist. I did not know about this for a long time.

Geolocate a given IP address
Defines a function to geolocate a given IP address; if none supplied, will default to your external IP address.

View webcam output using mplayer
View webcam output using mplayer, with correct fps and outfmt settings according to my webcam model.

Kill a process by its partial name
pkill is a standard command and kills processes Byte part of their name.

exclude file(s) from rsync
rsyncs files to a server excluding listed files also a file can be used to exclude common exclude rules and/or to exclude a ton of files, like so: $rsync --exclude-from '~/.scripts/exclude.txt' where exclude.txt has one rule per line: *.mp3 *.svn*


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: