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

Write comments to your history.
A null operation with the name 'comment', allowing comments to be written to HISTFILE. Prepending '#' to a command will *not* write the command to the history file, although it will be available for the current session, thus '#' is not useful for keeping track of comments past the current session.

Drop all tables from a database, without deleting it
Uses two comands, requieres mysqldump, but works as expected.

Recover resolution when a fullscreen program crashes and you're stuck with a tiny X resolution
This forces X back to its maximum resolution configured. To get a list, type `xrandr'.

A snooze button for xmms2 alarm clock
you can also run "xmms2 pause & at now +5min

Play online music videos in terminal
pvl 'link1' 'link2' 'link3' Play Youtube, Vimeo, etc links without visual elements. Great for music videos when you just want the audio. You can control mplayer with this! Hit Ctrl-C twice to exit (if you're playing multiple files)

Convert seconds into minutes and seconds
This is a very simple way to input a large number of seconds and get a more useful value in minutes and seconds. Avoids useless use of echo.

bash: display disks by id, UUID and HW path
Shows a tree of the disks. Requires "tree"

Check the package is installed or not. There will show the package name which is installed.
The ^python$ is a package name patten. You can change whatever you want.

Find files that are older than x days
Find files that are older than x days in the working directory and list them. This will recurse all the sub-directories inside the working directory. By changing the value for -mtime, you can adjust the time and by replacing the ls command with, say, rm, you can remove those files if you wish to.

sleep until X o'clock
pauses exactly long enough to wake at the top of the hour


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: