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

Use color grep by default
Alias the grep command to show colored results by default.

commandline dictionary
Note: 1) Replace 'wonder' with any word you looking the meaning for in the above example 2) Need to install these packages: wordnet & wordnet-base (latter should be automatically installed because of dependency) 3) Combined size of packages is about 30MB on my old ubuntu system (I find it worth it)

A command to post a message to Twitter that includes your geo-location and a short URL.
A command to post a message to Twitter that includes your geo-location and a short URL. The link shortening service is provide by TinyURL, the geo-location service is provided by HostIP and the IP address lookup service is provided by AppSpot. This is an upgrade of an of one of my previous contributions: http://tinyurl.com/yd2xtzv.

Insert a line at the top of a text file without sed or awk or bash loops
Yet another way to add a line at the top a of text file with the help of the tac command (reverse cat).

Extract title from HTML files
not the best, uses 4 pipes!

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

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

Convert CSV to JSON
Replace 'csv_file.csv' with your filename.

List the size (in human readable form) of all sub folders from the current location
Simple and easy to remember. -h is human, -d1 = depth 1. disk usage, human, depth 1

Get a list of the erroring cifs entries in fstab
It disturbs me when my logwatch report tells me a share or machine has disappeared, esp as mount isn't telling me what's gone. This command outputs to stderr the erroring cifs entries from fstab.


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: