Commands by unixmonkey37839 (2)

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

Do a command but skip recording it in the bash command history
Note the extra space before the command (I had to put it as an underscore since the website eats up preceding spaces). That's all it takes. Now if you check your history with "$ history", it wont show up.

Recover resolution when a fullscreen program crashes and you're stuck with a tiny X resolution
This forces X back to its maximum resolution configured. To get a list, type `xrandr'.

Find which jars contain a class

Show a file in less without wrapping long lines

clean up syntax and de-obfuscate perl script
the command show can be run in vim, here is the same thing on the command line $ cat script.pl | perl -MO=Deparse | perltidy

Reducing image size
Adding the exclamation mark to the image geometry ignores the original aspect ratio. More info about image geometry: http://www.imagemagick.org/script/command-line-processing.php#geometry

Find all files of a type and copy them elsewhere while keeping intact their full directory structure using find and cpio
.flac is the filetype. /Volumes/Music/FLAC is the destination.

Split and join with split and cat.
`split -b 1k file` splits files into 1k chunks. Rejoin them with `cat x* > file`.

watch your network load on specific network interface
-n means refresh frequency you could change eth0 to any interface you want, like wlan0

AWK Calculator


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: