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

Rename files in batch

tail: watch a filelog
-f file(s) to be monitorized -n number of last line to be printed on the screen in this example, the content of two files are displayed

Know which modules are loaded on an Apache server
This let you know which modules has loaded the Apache server, very useful to know if the mod_rewrite is ready to use.

currently mounted filesystems in nice layout
since fuse mounts do not appear in /etc/mtab (fuse can't write there, dunno if it would if it could) this is propably a better way.

count how many times a string appears in a (source code) tree
grep -o puts each occurrence in a separate line

Add thousand separator with sed, in a file or within pipe
Does not necessarily require a file to process, it can be used in a pipe as well: $ cat filename | sed -e :a -e 's/\(.*[0-9]\)\([0-9]\{3\}\)/\1,\2/;ta' I don't remember where I copy/pasted this from, I wish I credited the original author

determine if tcp port is open
@putnamhill, no need if statement in that case. && is a AND and || is a OR

Pulls email password out of Plesk database for given email address.
This simply pulls the password out of the database for the given mail name for ease of use in testing emails that you would not normally have access to.

Factorial With Case
Computes factorials.

Report the established connections for a particular port


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: