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

kills rapidly spawning processes that spawn faster than you can repeat the killall command
if you dont want to alias also then you can do killall rapidly_spawning_process ; !! ; !! ; !!

Scrollable Colorized Long Listing - Hidden Files Sorted Last
To sort hidden files first, simply switch the two inner `ls` commands. I have this aliased to `dira` `dir` is aliased to the simpler version with no hidden files: $ ls -l --color=always | less -R

Search back through previous commands
Searches backwards through your command-history for the typed text. Repeatedly hitting Ctrl-R will search progressively further. Return invokes the command.

start a tunnel from some machine's port 80 to your local post 2001
now you can acces the website by going to http://localhost:2001/

seconds since epoch to ISO timestamp
No need to use perl, awk, nor /usr/bin/date -- bash's "printf" builtin will do it.

Find the package that installed a command

When feeling down, this command helps
$ sudo apt-get install sl $ man sl

copy with progress bar - rsync
-r for recursive (if you want to copy entire directories) src for the source file (or wildcards) dst for the destination --progress to show a progress bar

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

Use Cygwin to talk to the Windows clipboard
I spent a bunch of time yesterday looking for the xsel package in Cygwin- turns out you can use the /dev/clipboard device to do the same thing.


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: