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

Rename files in batch

Get IP from host
I just wanted a simple DNS request. Because host and nslookup commands are not on all systems, we use getent instead. Thanks aulem for that tip.

Find the package that installed a command

What is My WAN IP?
The curl command retrieve the HTML text containing the IP address. The grep command picks out the IP address from that HTML text.

git remove files which have been deleted
It deletes all removed files, updates what was modified, and adds new files.

Insert a line for each n lines
specially usefull for sql scripts with insert / update statements, to add a commit command after n statements executed.

Purge configuration files of removed packages on debian based systems
also search with aptitude search '~c'

Mount folder/filesystem through SSH
Install SSHFS from http://fuse.sourceforge.net/sshfs.html Will allow you to mount a folder security over a network.

Matrix Style
Same as above but slooooow it down

mtr, better than traceroute and ping combined
mtr combines the functionality of the traceroute and ping programs in a single network diagnostic tool. As mtr starts, it investigates the network connection between the host mtr runs on and HOSTNAME. by sending packets with purposly low TTLs. It continues to send packets with low TTL, noting the response time of the intervening routers. This allows mtr to print the response percentage and response times of the internet route to HOSTNAME. A sudden increase in packetloss or response time is often an indication of a bad (or simply over‐loaded) link.


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: