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

Visualizing system performance data

ssh -A user@somehost
the -A argument forwards your ssh private keys to the host you're going to. Useful in some scenarios where you have to hop to one server, and then login to another using a private key.

Search git logs (case-insensitive)
Normally, searching git log comments is case sensitive. The -i luckily applies to the --grep switch.

geoip information
Not my script. Belongs to mathewbauer. Used without his permission. This script gives a single line as shown in the sample output. NOTE: I have blanked out the IP address for obvious security reasons. But you will get whatever is your IP if you run the script. Tested working in bash.

Get all files of particular type (say, PDF) listed on some wegpage (say, example.com)
See man wget if you want linked files and not only those hosted on the website.

List upgrade-able packages on Ubuntu
Taken from apticron and modified.

recursive search and replace old with new string, inside files
Using -Z with grep and -0 with xargs handles file names with spaces and special characters.

Cleanup Docker
# Delete all containers docker rm $(docker ps -a -q) # Delete all images docker rmi $(docker images -q)

tcpdump whole packets to file in ascii and hex with ip adresses instead of hostname

get a directory from one machine to another using tar and ssh


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: