Commands by pipping (6)

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

Remove leading zeros in multiple columns with sed
Leading zeros might help correct sorting and they can be removed by sed after sorting

Convert JSON to YAML (unicode safe)
If you tried the other Python version of Convert JSON to YAML and you end up with lines that has "!!python/unicode", this version of the command is for you.

Copy the sound content of a video to an mp3 file
-vn removes tha video content, the copy option tells ffmpeg to use the same codec for generating the output

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

add the result of a command into vi
':r!ls -l' results in listing the files in the current directory and paste it into vi

Hypnosis
rather don't depend on those sleepin'pills http://en.wikipedia.org/wiki/Counting_sheep

Find broken symlinks and delete them
recursively deletes all broken symlinks using zsh globbing syntax.

Create date-based tgz of current dir, runs in the background, very very cool
This is freaking sweet!!! Here is the full alias, (I didn't want to cause display problems on commandlinefu.com's homepage): $ alias tarred='( ( D=`builtin pwd`; F=$(date +$HOME/`sed "s,[/ ],#,g"

List of directories sorted by number of files they contain.

Execute a command on multiple hosts in parallel
Ssh to host1, host2, and host3, executing on each host and saving the output in {host}.log. I don't have the 'parallel' command installed, otherwise it sounds interesting and less cryptic.


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: