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 the package that installed a command

tmux start new session with title and execute command
in this examp start htop command in tmux session over the shell cosole and set title for the tmux without doing it manuelly in tmux

Check every URL redirect (HTTP status codes 301/302) with curl
curl -sLkIv --stderr - https://t.co/2rQjHfptZ8 -s: silences the output when piped to a different command -L: follow every redirect -k: ignores certificate errors -I: just request the headers -v: be verbose --stderr - : redirect stderr to stdout https://t.co/2rQjHfptZ8: URL to check for redirects piped to grep -i location: -i: grep target text ignoring case location: : greps every string containing "location:" piped to awk {'print $3'} prints the third column in every string piped to sed '/^$/d' removes blank lines

Generate Random Text based on Length

coloured tail
tail with coloured output with the help of perl - need more colours? here is a colour table: http://www.tuxify.de/?p=23

Count occurrences per minute in a log file
The cut should match the relevant timestamp part of the logfile, the uniq will count the number of occurrences during this time interval.

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"

fork performance test
grabbed from Andrew Aylett post: http://superuser.com/questions/133313/can-i-speed-up-cygwins-fork

compare two Microsoft Word documents
http://meld.sourceforge.net/ http://www.winfield.demon.nl/

Create a system overview dashboard on F12 key
Command binds a set of commands to the F12 key. Feel free to alter the dashboard according to your own needs. How to find the key codes? Type $ read Then press the desired key (example: F5) $ ^[[15~ Try $ bind '"\e[15~"':"\"ssh su@ip-address\C-m""" or $ bind '"\e[16~"':"\"apachectl -k restart\C-m"""


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: