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

Lines per second in a log file
Another way of counting the line output of tail over 10s not requiring pv. Cut to have the average per second rate : tail -n0 -f access.log>/tmp/tmp.log & sleep 10; kill $! ; wc -l /tmp/tmp.log | cut -c-2 You can also enclose it in a loop and send stderr to /dev/null : while true; do tail -n0 -f access.log>/tmp/tmp.log & sleep 2; kill $! ; wc -l /tmp/tmp.log | cut -c-2; done 2>/dev/null

Tweak system files without invoking a root shell
only for sudo-style systems. Use this construct instead of I/O re-directors ``>'' or ``>>'' because sudo only elevates the commands and *not* the re-directors. ***warning: remember that the `tee` command will clobber file contents unless it is given the ``-a'' argument Also, for extra security, the "left" command is still run unprivileged.

Send an http HEAD request w/curl

Remove audio stream from a media file
This syntax also works for ffmpeg as avconv is a fork of ffmpeg.

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.

return external ip

output absolute path of the present working directory
I've seen a lot of overly complicated attempts at figuring out "where am I?" I think this is a part of the problem: type -a pwd force the use of the binary version of `pwd` instead of the built-in with "/bin/pwd -P" -P option provides an absolute path to the present working directory for the overly cautious type: $(which pwd) -P

Install the Debian-packaged version of a Perl module
Running 'cpan Module::Name' will install that module from CPAN. This is a simple way of using a similar command to install a packaged Perl module from a Debian archive using apt-get.

Find an installed app

cpu stress test
For each cpu set mask and then monitor your cpu infos. Temp,load avg. etc. For example for 2nd cpu or 2nd core taskset 0x00000002 yes > /dev/null & For example for 3rd cpu or 3rd core taskset 0x00000004 yes > /dev/null & For example for 4th cpu or 4th core taskset 0x00000008 yes > /dev/null & Monitor your cpu temp with this command if you want watch -n1 "acpi -t" Load avg. from top command top kerim@bayner.com http://www.bayner.com/


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: