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

Suspend to ram
No need to be root to do that. Relies on UPower (previously known as DeviceKit-Power).

Escape forward slashes in a variable
For example $ path="/etc/apt/sources.list"; echo ${path//'/'/'\/'} will print $ \/etc\/apt\/sources.list

Command line calculator
This function defines a command line calculator that handles everything pythons math module can handle, e.g. trigonometric functions, sqrt, log, erf, ... (see http://docs.python.org/library/math.html). It even knows about the constants pi and e.

sort list of email addresses by domain.tld
email random list can be created here: https://www.randomlists.com/email-addresses

get cookies from firefox
useful to use after with the --load-cookies option of wget

merge vob files to mpg

Increment the filename of png in a given directory by one

Install pip with Proxy
Installs pip packages defining a proxy

access to last touched or created file with arrow_up_key immediately after displaying the file list
Display recursive file list (newest file displayed at the end) and be free to access last file in the list simply by pressing arrow_up_key i.e. open it with joe editor. BTW IMHO the list of files with newest files at the end is often more informative. Put this 'lsa' function somewhere in your .bashrc and issue $ . ~/.bashrc or $ source ~/.bashrc to have access to the 'lsa' command immediately. . (the function appends command "joe last_file_in_the_list" at the end of command history)

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"


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: