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

Reboot as a different OS in Grub
This will reboot as the Grub 2 option.

list files recursively by size

Limit the cpu usage of a process
This will limit the average amount of CPU it consumes.

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"

Undo
Ctrl+_

display emerge.log date in a human friendly way
gentoo only or gentoo-like linux distributions.

Switch all connected PulseAudio bluetooth devices to A2DP profile
Tries to switch all audio devices to the A2DP profile for optimal sound quality. Useful for bluetooth speakers and headphones that always power up in HSP/HFP mode. Note however that this command is only a shorthand for the GUI, so it cannot fix stubborn BT controllers that leave your device stuck in HSP mode until a manual re-coupling.

Execute matlab sentences from command line
Execute matlab sentences in shell script: for var in `seq 0 0.2 1` ; do echo "my_function($var);" | matlab -nodisplay done

share internet connection with only one network interface
the below command create a alias for share your internet connection with another. $ifconfig eth0:1 192.168.0.1/24 Its obviously necessary too activate the iptables post-routing and ip forwarding, as root: $modprobe iptable_nat $iptables -t nat -A POSTROUTING -o eth0 -j MASQUERADE $echo 1 > /proc/sys/net/ipv4/ip_forward Be sure that the alias 192.168.0.0/24 is not your active real ip range

Prepend a text to a file.
Using the sed -i (inline), you can replace the beginning of the first line of a file without redirecting the output to a temporary location.


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: