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

set a reminder for 5 days in the future
setup for reminder in 5 days, added the date in the future. To run a job at 4pm three days from now, you would do at 4pm + 3 days, to run a job at 10:00am on July 31, you would do at 10am Jul 31 and to run a job at 1am tomorrow, you would do at 1am tomorrow.

Prints per-line contribution per author for a GIT repository
Uses line-porcelain in git blame, which makes it easier to parse the output.

Pipe stdout and stderr, etc., to separate commands
You can use [n]> combined with >(cmd) to attach the various output file descriptors to be the input of different commands.

Run a bash script in debug mode, show output and save it on a file
Sends both stdout and stderr to the pipe which captures the data in the file 'out.test' and sends to stdout of tee (likely /dev/tty unless redirected). Works on Bourne, Korn and Bash shells.

rgrep: recursive grep without .svn
Only excludes .svn from filenames.

Open Port Check
also could specify port number: lsof -ni TCP:80

ping a range of IP addresses
nmap accepts a wide variety of addressing notation, multiple targets/ranges, etc.

Print all the lines between 10 and 20 of a file
Subtly different to the -n+p method... and probably wrong in so many ways....... But it's shorter. Just.

watch your network load on specific network interface
-n means refresh frequency you could change eth0 to any interface you want, like wlan0

remove execute bit only from files. recursively


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: