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

View non-printing characters with cat
Useful to detect number of tabs in an empty line, DOS newline (carriage return + newline). A tool that can help you understand why your parsing is not working.

check open ports without netstat or lsof

let a cow tell you your fortune

easily strace all your apache processes
Will open strace on all apache process, on systems using sbin/apache (debian) or sbin/httpd (redhat), and will follow threads newly created.

Bypass 1000 Entry limit of Active Directory with ldapsearch
That command bypass the entry limit specifing page results size, when the search arrive to the limit ldapsearch magically reiterate it from the last entry.

Get your external IP address if your machine has a DNS entry
Easy way to see your real external IP

Run a long job and notify me when it's finished
You will need libnotify-bin for this to work: $ sudo aptitude install libnotify-bin

Intercept, monitor and manipulate a TCP connection.
Forwards localhost:1234 to machine:port, running all data through your chain of piped commands. The above command logs inbound and outbound traffic to two files. Tip: replace tee with sed to manipulate the data in real time (use "sed -e 's/400 Bad Request/200 OK/'" to tweak a web server's responses ;-) Limitless possibilities.

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"

scan whole internet and specific port in humanistic time
apt-get install git gcc make libpcap-dev git clone https://github.com/robertdavidgraham/masscan cd masscan make install -pDm755 bin/masscan /usr/bin/masscan


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: