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

Get a list of IP Addresses that have failed to login via SSH
This command shows a sorted list of the IP addresses from which there have been authentication errors via SSH (possible script kiddies trying to gain access to your server), it eliminates duplicates so it's easier to read, but you can remove the "uniq" command at the end, or even do a "uniq -c" to have a count of how many times each IP address shows in the log (the path to the log may vary from system to system)

Recursively grep thorugh directory for string in file.
Print line numbers also, so you don't have to search through the files once its open for the string you already grepped for.

Read Python logs with tracebacks in color

Binary clock
Fun idea! This one adds seconds and keeps running on the same line. Perl's probably cheating though. :)

backup your entire hosted website using cPanel backup interface and wget
this will connect to your hosted website service through the cPanel interface and use its backup tool to backup and download the entire website, locally. (do not forget to replace : YourUsername , YourPassword and YourWebsiteUrl for it to work )

Sprunge.us - CLI alternative to PasteBin.com
NAME sprunge: command line pastebin: SYNOPSIS | curl -F 'sprunge=

Immediately put execute permission on any file saved/created in $HOME/bin

Batch Convert SVG to PNG
Convert some SVG files into PNG using ImageMagick's convert command.

Re-read partition table on specified device without rebooting system (here /dev/sda).

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


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: