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

Colorize matching string without skipping others
this is useful to highlight only some code without losing other lines (eg. software, logs, scripts)

Count the number of characters in each line

"at" command w/o the resource usage/competition issues
EXAMPLES jb "next sun 12pm" "/bin/sh ~you/1.sh" & jb "2010-08-29 12:00:00" "~you/1.sh" & jb "29aug2010 gmt" ". ~you/1.sh" & jb 12:00p.m. "nohup ./1.sh" & jb 1min "echo stop!" & SEE ALSO parsedate(3) strftime(3)

SVN Command line branch merge
This will merge all of the changes from {rev_num} to head on the branch to the current working directory

Create a bunch of dummy text files

tar+pbzip2 a dir

bulk dl files based on a pattern
-O switch creates local filename same as remote curl [][] -o #1#2 makes local files unique inserting sequence values into #x placeholders sequences can be alpha or numeric e.g [a-z] [1-25]

Get listening ports on a localhost
ss is a tool that will help you to get all kinds of useful information about the current sockets on a localhost. You can also get the uid of the daemons process using the flag: $ ss -le

Find files of two different extensions and copy them to a directory

Show (only) list of files changed by commit
Lists ONLY the files changed by the given HASH/HEAD/list of hashes, etc. The message, commit ID, author, etc. is not included


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: