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

Filter IPs out of files

Detect encoding of a text file
This command gives you the charset of a text file, which would be handy if you have no idea of the encoding.

Check if variable is a number

Create a continuous digital clock in Linux terminal
Source: http://www.my-guides.net/en/guides/linux/364-how-to-create-a-continuous-digital-clock-in-linux-terminal

Check whether IPv6 is enabled
Checks whether IPv6 is enabled system-wide by reading from procfs.

Block all IP addresses and domains that have attempted brute force SSH login to computer
Searches all log files (including archived bzip2 files) for invalid user and PAM authentication errors, both of which are indicative of brute force attempts at logging into computer. A list of all unique IP addresses and domain names is appended to hosts.deny. The command (and grep error messages) will work on Mac OS X 10.6, small adjustments may be needed for other OSs.

check open ports without netstat or lsof

Create a tar file with the current date in the name.

Convert .flv to .3gp
Download YouTube videos as .flv and convert them to .3gp for your mobile phone.

List all the files that have been deleted while they were still open.
If your customer deletes a file that is still in use by a process, that space does not get freed up (will not show up in df) until that process either closes the file on its own, or is killed.


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: