Commands by chaliyans (1)

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

Find all files that have nasty names
Get a list of file names that may cause problems (eg being served on a webserver, typing a URL on a mobile, etc)

Numeric zero padding file rename
This uses Perl's rename utility (you may have to call it as prename on your box) and won't choke on spaces or other characters in filenames. It will also zero pad a number even in filenames like "vacation-4.jpg".

Create a new file

Make changes in .bashrc immediately available

Url Encode
This one uses hex conversion to do the converting and is in shell/sed only (should probably still use the python/perl version).

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

Dump a web page
Useful to browse dangerous web sites.

Reduce PDF size

What is My WAN IP?
The curl command retrieve the HTML text containing the IP address. The grep command picks out the IP address from that HTML text.

Find C/C++ source code comments
This is a naive way of finding source code comments in source code files that use C-like comments: // and /*...*/


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: