Commands by sputnick (42)

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

Indent a one-liner.
I often write a one-liner which I want to use later in a script.

find an unused unprivileged TCP port
Not really better - just different ;) There's probably a really simple solution out there somewhere...

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

Process command output line by line in a while loop
This snippet allows to process the output of any bash command line by line.

Catch a proccess from a user and strace it.
It sits there in a loop waiting for a proccess from that user to spawn. When it does it will attach strace to it

Spy audio, it only records if detects a sound or noise
It find out the mic recording level at the moment of run the command and if a noise level is higher it starts to record an mp3 file. The resulting file will have only the sounds not the silences.

What is my ip?

Outputs a sorted list of disk usage to a text file
Recursively searches current directory and outputs sorted list of each directory's disk usage to a text file.

Extract your list of blocked images hosts from Firefox database
I use this to replicate my blocked images hosts list between work and home to keep my browsing ad-free.

Re-emerge all ebuilds with missing files (Gentoo Linux)
Revised approach to and3k's version, using pipes and read rather than command substitution. This does not require fiddling with IFS when paths have whitespace, and does not risk hitting command-line size limits. It's less verbose on the missing files, but it stops iterating at the first file that's missing, so it should be definitely faster. I expanded all the qlist options to be more self-describing.


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: