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

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"

Assign function keys to your frequent commands
This is a common use of bind. Hitting any key after will output the key's character sequence. This makes possible using it into a bind command. So pressing ctrl+v and then F2 will output "^[[12~", once binded every time you'll press the function key F2 it will execute your command. Added the \n to make it execute it as well.

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"

show the date every rpm was installed
the newest rpms are at the top; individual packages can also be queried this way: rpm --last -q package

sort ugly text
Often, when sorting you want the sort to ignore extraneous characters. The b, d, and f tell sort to ignore leading blanks, use 'dictionary order' (ignore punctuation), and ignore (fold) case. Add a "u" if you only want one copy of duplicate lines. This is a great command to use within vim to sort lines of text, using !}sort -bdf

dstat- this command is powerful one to monitor system activity . It has combined the power of vmstat,iostat,mpstat,df,free,sar .
As mentioned in the summery that it is a powerful command to monitor system activity in great way. It has got the power of vmstat,iostat,mpstat,df,free and sar.Instead of firing each single command separately ,one can fire one single command to get all the info at once.But there is a way to get the individual information too. Please see the man page . You can get it from here : http://dag.wieers.com/home-made/dstat/

translate what is in the clipboard in english and write it to the terminal
Uses google api to translate, you can modify the language in which translate modifying the parameter "langpair=|en", the format is language input|language output.

Generate QR code for a WiFi hotspot
Prompts for network name (SSID) and password, and generates (as qr-wifi.png) a WiFi QR code (e.g. "WIFI:S:mynet;T:WPA;P:mypass;;" for mynet/mypass). Dependencies [sudo apt-get install]: qrencode zenity

check open ports without netstat or lsof

Equivalent to ifconfig -a in HPUX


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: