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

Generate Sha1, MD5 hash using echo
This is mostly for my own notes but this command will compute a md5 message digest from the command line. You can also replace md5sum with other checksum commands (e.g., sha1sum)

Copy history from one terminal to another
Or just do history -w before opening another terminal.

Backup file, create dir and set perms in one shot
Prior to working on/modifying a file, use the 'install -m' command which can both copy files, create directories, and set their permissions at the same time. Useful when you are working in the public_html folder and need to keep the cp'd file hidden.

Change the homepage of Firefox
Pros: Works in all Windows computers, most updated and compatible command. Cons: 3 liner Replace fcisolutions.com with your site name.

Find the package that installed a command

Install Linux Kernel Headers on Debian-based systems
Install the Linux kernel headers for currently running kernel version on Debian-based systems via apt-get

Get the 10 biggest files/folders for the current direcotry

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

randomize hostname and mac address, force dhcp renew. (for anonymous networking)
this string of commands will release your dhcp address, change your mac address, generate a new random hostname and then get a new dhcp lease.

Delay execution until load average falls under 1.5
If shell escaping of the command is problematic, you can write the command to a file first: $ batch


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: