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

Stream YouTube URL directly to mplayer.

Makes a Zenity select list based on entries in your wpa_supplicant.conf
If you still connect to your wireless access point manually and need to use wpa_supplicant, the above fu will grep all of the known SSID from your wpa_supplicant.conf file, present it in a Zenity list and return the SSID name you choose. I've wrapped this command in to a bash script that then up's the interface, associates and autenticates. Saves me from using NetworkManager ;)

Process command output line by line in a while loop
This snippet allows to process the output of any bash command line by line.

Resume an emerge, and keep all object files that are already built
For Gentoo: If you do not use this command, portage will fetch the source again, and rebuild the hole application from the top. This command make portage keep all files that ar allready built

Show all listening and established ports TCP and UDP together with the PID of the associated process
Easy to remenber. Fot TCP only use: netstat -plant

Detect illegal access to kernel space, potentially useful for Meltdown detection
Based on capsule8 agent examples, not rigorously tested

Disable sending of start/stop characters
This command disable sending of start/stop characters. It's useful when you want to use incremental reverse history search forward shortcut (Ctrl+s). To enable again, type: $ stty -ixoff

Compute running average for a column of numbers
This is an on-line algorithm for calculating the mean value for numbers in a column. Also known as "running average" or "moving average".

Restrict the use of dmesg for current user/session
Linux offers an interesting option to restrict the use of dmesg. It is available via /proc/sys/kernel/dmesg_restrict. You can check the status with: $ cat /proc/sys/kernel/dmesg_restrict Alternatively you can use sysctl: $ sudo sysctl -w kernel.dmesg_restrict=1 To make your change persistent across reboot, edit a fille in /etc/sysctl.d/.

history autocompletion with arrow keys
This will enable the possibility to navigate in the history of the command you type with the arrow keys, example "na" and the arrow will give all command starting by na in the history.You can add these lines to your .bashrc (without &&) to use that in your default 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: