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

Backup trought SSH

list all file extensions in a directory
Works on current directory, with built-in sorting.

A bit of privacy in .bash_history
Don't track in history commands starting with whitespace. Moreover ignore duplicates from history. To be set in .bashrc ex. $ export HISTCONTROL=ignoreboth $   echo antani $   history|grep -c antani 0

Beep siren
Infinitely plays beeps with sinusoidally changing sound frequency. Ideal for alarm on an event.

Create a 5 MB blank file
Useful for testing purposes

print contents of file from first match of regex to end of file
Search in "filename" for the first line to match regex, and print to stdout from the matching line to the end of the file.

Check if filesystem hangs
When a fs hangs and you've just one console, even # ls could be a dangerous command. Simply put a trailing "&" and play safe

bash screensaver (scrolling ascii art with customizable message)
Displays a scrolling banner which loops until you hit Ctrl-C to terminate it. Make sure you finish your banner message with a space so it will loop nicely.

calulate established tcp connection of local machine
If you want prepend/append text just wrap in echo: $echo Connected: `netstat -an|grep -ci "tcp.*established"`

Sysadmin day date of any given year
Calculate the date of Sysadmin day (last Friday of July) of any given year


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: