All commands (14,184)

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

convert single digit to double digits
each number in a file name gets expanded to the number of digets provided as arg_1 of the arguments in rjust_file_nums. Put the funciton in the .bashrc file. Be sure to $ source ~/.bashrc so that the function will be accessible from bash.

Sort netflow packet capture
Sort netflow packet capture by unique connections excluding source port.

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"

batch crop images whit ImageMagick
Just starting to get in love with mogrify.

Synchronize date and time with a server over ssh
using -u is better for standardizing date output and timezones, for servers in different timezones.

Welcome humans!
Some information about robots. :-)

Mount a partition from dd disk image
Assuming we have a disk image, ie. created by $dd if=/dev/sda of=image.dd we can check the image's partition layout with $fdisk -ul image.dd then, we substitute "x" with starting sector of the partition we want to mount. This example assumes that the disk uses 512 B sectors

Get your external IP address if your machine has a DNS entry
Easy way to see your real external IP

add all files not under version control to repository
With the force options the same results can be achieved

Get the size of all the directories in current directory (Sorted Human Readable)
This allows the output to be sorted from largest to smallest in human readable format.


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: