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

Launch a game, like Tetris, when apt-get installing an app larger than 50 Megabytes
Change the APP variable's value to whatever you want to install. Depending on how fast your machine is, you'll want to adjust the value 50 to something else. You might also want to play a different game than Gnometris - just make sure it's a GUI game.

Close a hanging ssh session
~ is the ssh control character. If you type it after a newline, you can example force close the ssh session. , ~, then . If you want more info, type ~? when you are connecting using ssh. Very useful to kill of any hanging ssh sessions when nothing else works.

Console clock
Turn your terminal into digital clock.

Sort and count subjects of emails stuck in Exim queue

Find files and calculate size of result in shell
Using find's internal stat to get the file size is about 50 times faster than using -exec stat.

Source zshrc/bashrc in all open terminals
Put this in your zshrc, source it, then run 'pkill -usr1 zsh' to source it in all open terminals. Also works with bash. More info: http://www.reddit.com/r/commandline/comments/12g76v/how_to_automatically_source_zshrc_in_all_open/

"What the hell is running on?!" Easily snoop your system's RAM consumption
Works on most unixes, on OpenBSD replace the "-g" parameter at the sort with a "-n".

create shortcut keys in bash

shows history of logins on the server
perfect on a crashed system where you can't use commands like last. for investigation purposes wtmp file can be copied over to a different server and read with utmpdump

get the full description of a randomly selected package from the list of installed packages on a debian system
I put this command on my ~/.bashrc in order to learn something new about installed packages on my Debian/Ubuntu system each time I open a new terminal


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: