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

archlinux: find more commands provided by the package owning some command
uses the pkgfile command (part of the community repository), highly suggested.

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.

Multi line grep using sed and specifying open/close tags
This line does not include your closing tag in the output.

Fetch all GPG keys that are currently missing in your keyring
For instance, if people have signed your key, this will fetch the signers' keys.

Find usb device
I often use it to find recently added ou removed device, or using find in /dev, or anything similar. Just run the command, plug the device, and wait to see him and only him

Use acpi and notify-send to report current temperature every five minutes.
Use acpi and notify-send to report current temperature every five minutes. Works best in a shell script run at startup. acpi is called for temperature and fed to notify-send for a tooltip. After waiting five minutes, it will start over.

Find broken symlinks
To understand why this is the equivalent of "find -L /path/to/search -type l, see http://ynform.org/w/Pub/FindBrokenSymbolicLinks or look at http://www.gnu.org/software/findutils/manual/html_mono/find.html

Real time duplication of Apache app traffic to a second server
This takes the stream created by apache requests containing jsp and funnels them to another server. I'm using this for simulating real time traffic. The nice command gives ssh maximum CPU cycles, awk & grep strip out everything served by apache. Putting parallel on curl is important because curl is synchronous and waits for the response. Yes, I thought about using wget but it didn't seem any easier. Also, if you figure out how to run this in the background let me know. Every time I background it it stops. If you have multiple front end servers just run multiple instances of this.

Flush DNS cache in MacOS 10.5

Look for English words in /dev/urandom
* to get the English dictionary: wget http://www.mavi1.org/web_security/wordlists/webster-dictionary.txt


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: