Commands tagged tricks (5)

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

Show drive names next to their full serial number (and disk info)
As of this writing, this requires a fairly recent version of util-linux, but is much simpler than the previous alternatives. Basically, lsblk gives a nice, human readable interface to all the blkid stuff. (Of course, I wouldn't recommend this if you're going to be parsing the output.) This command takes all the fun out of the previous nifty pipelines, but I felt I ought to at least mention it as an alternative since it is the most practical.

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"

add lyrics

Docker.io Stop and Remove all processes
Will stop all running containers, then remove all containers **This isn't for selectively handling containers, it removes everything**

Locate config files of the program
Locate config files of the program. May not be used for interactive programs like vim.

Display all readline binding that use CTRL
Useful for getting to know the available keyboard shortcuts.

Find usb device in realtime
Using this command you can track a moment when usb device was attached.

get useful statistics from tcpdump (sort by ip)
We can get useful statistics from tcpdump with this simple command. Thanks "Babak Farrokhi" to teaching me this ;)

Go (cd) directly into a new temp folder
This command create a new temp directory using mktemp (to avoid collisions) and change the current working directory to the created directory.

a function to find the fastest DNS server
http://public-dns.info gives a list of online dns servers. you need to change the country in url (br in this url) with your country code. this command need some time to ping all IP in list.


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: