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

Remove a range of lines from a file
Delete a range of line

Find files with at least one exec bit set

Use top to monitor only all processes with the same name fragment 'foo'
top accecpts a comma separated list of PIDs.

Number of CPU's in a system
this works for a Linux based system, other UNIX systems may have other way(s) to check the number of CPUs.

Compress excutable files in place.
The gzexe utility allows you to compress executables in place and have them automatically uncompress and execute when you run them. FYI: You can compress any executable sha-bang scripts as well (py, pl, sh, tcl, etc.).

Show which programs are listening on TCP ports
Alternative: $ ss -tlpn

Prettify an XML file
Like `tidy`, `xmllint` can be used to prettify XML files. The --nsclean option is also useful to remove redundant namespaces.

Mount a disk image (dmg) file in Mac OSX
To unmount, replace "attach" with "eject"

Count the number of characters in a string from the standard input.

Check syntax of remote ruby file


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: