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

Replace all forward slashes with backward slashes
Use -i option to edit directly a file: sed -i 's|\/|\\|g' file

Suspend to ram

Let's make screen and ssh-agent friends
When you start screen as `ssh-agent screen`, agent will die after detatch. If you don't want to take care about files when stored agent's pid/socket/etc, you have to use this command.

create pdf files from text files or stdout.

Recursively find disk usage, sort, and make human readable (for systems without human-readable sort command)
Recursively find disk usage, sort, and make human readable: * For systems without human-readable sort command * awk, not perl

Sorted, recursive long file listing
Tells you everything you could ever want to know about all files and subdirectories. Great for package creators. Totally secure too. On my Slackware box, this gets set upon login: $ LS_OPTIONS='-F -b -T 0 --color=auto' and $ alias ls='/bin/ls $LS_OPTIONS' which works great.

ls -hog --> a more compact ls -l
I often deal with long file names and the 'ls -l' command leaves very little room for file names. An alternative is to use the -h -o and -g flags (or together, -hog). * The -h flag produces human-readable file size (e.g. 91K instead of 92728) * The -o suppresses the owner column * The -g suppresses the group column Since I use to alias ll='ls -l', I now do alias ll='ls -hog'

print all characters of a file using hexdump
'od -c' works like 'hexdump -c' but is available on other operating systems that don't ship with hexdump (e.g. solaris).

Show all symlinks

Get all mac address


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: