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

From Vim, run current buffer in python

Remote execute command as sudoer via ssh
Example: remote install an application(wine). sshpass -p 'mypssword' ssh -t mysshloginname@192.168.1.22 "echo 'mypassword' | sudo -S apt-get install wine" Tested on Ubuntu.

Print a list of the 30 last modified mp3s sorted by last first

Create a file of repeated, non-zero
dd can be used with /dev/zero to easily create a file of all zero-bytes. Pipe that through tr and use octal conversions to change the byte values from zero to 0xff (octal 0377). You can replace 0377 with the byte of your choice. You can also use \\0 and \\377 instead of the quoted version.

Parse compressed apache error log file and show top errors
credit shall fall to this for non-gzipped version: https://gist.github.com/marcanuy/a08d5f2d9c19ba621399

Shows cpu load in percent
Show the current load of the CPU as a percentage. Read the load from /proc/loadavg and convert it using sed: Strip everything after the first whitespace: $ sed -e 's/ .*//' Delete the decimal point: $ sed -e 's/\.//' Remove leading zeroes: $ sed -e 's/^0*//'

Edit Camera Model in metadata:

Remove all files except list

list block devices
Shows all block devices in a tree with descruptions of what they are.

PDF simplex to duplex merge
Joins two pdf documents coming from a simplex document feed scanner. Needs pdftk >1.44 w/ shuffle.


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: