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

Find all dotfiles and dirs
find makes it easier, filtering . and .. maxdepth could be removed, finding entries recursively. Removing mindepth causes . to appear

Delete all non-printing characters from a file
tr has some predefined sets of characters that are more convenient to use than characters codes

Convert unix timestamp to date
The "-d" option for gnu's "date" command can calculate positive or negative offset from any time, including "now". You can even specify a source timezone (the output timezone can be set with the TZ environment variable). Useful! Fun! Not very well documented!

Print a list of all hardlinks in the working directory, recursively
libpurple likes to hardlink files repeatedly. To ignore libpurple, use sed: | sed '/\.\/\.purple/d'

pdfcount: get number of pages in a PDF file

calulate established tcp connection of local machine

Decrypt exported android wallet keys for import into desktop client (LTC,FTC,BTC)

remove execute bit only from files. recursively

Alternative size (human readable) of files and directories (biggest last)
using mb it's still readable;) a symbol variation $ du -ms {,.[^.]}* | sort -nk1

enumerate with padding
bash2 : for X in $(seq 1 5); do printf "%03g " "$X";done bash3 : for X in {1..5}; do printf "%03g " "$X";done bash4 : echo {001..5}


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: