Commands by kumarrav90 (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

Count TCP States From Netstat
Counts TCP states from Netstat and displays in an ordered list.

Which processes are listening on a specific port (e.g. port 80)
swap out "80" for your port of interest. Can use port number or named ports e.g. "http"

One liner to parse all epubs in a directory and use the calibre ebook-convert utility to convert them to mobi format
all ebook-convert -options are optional. all you really need to pass ebook-convert is the incoming and outgoing names, with extensions. Has been tested on Ubuntu 10.10

Show bash's function definitions you defined in .bash_profile or .bashrc
If you omit the function name, the command will display all definitions

list files recursively by size

run php code inline from the command line
Most people know that you can run a PHP script from the command line like so: $php ./my_script.php But sometimes I just want to run a quick bit of code, the PHP Command Line Interface allows me to do so with the -r option. Requires package php5-cli

Remove today's installed packages

Dump mySQL db from Remote Database to Local Database
You can use this to dump you database from remote db to your local db.

Find and copy scattered mp3 files into one directory
I used this command to recursively gather all mp3 files that were previously imported into their own directories (sorted by band name) in Songbird.

batch crop images whit ImageMagick
Just starting to get in love with mogrify.


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: