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

Get the current svn branch/tag (Good for PS1/PROMPT_COMMAND cases)
uses just one sed

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

Print the IP address and the Mac address in the same line
Print the IP address and the Mac address in the same line

Get a docker container's run command line
A good way to build a new container when you don't remember how you did it the first time

Dump android contacts, sms
Crude, but works. Note for security, /data/ will be inaccessible unless your device has been *rooted*. On the other hand, if a device has been rooted, its data is now wide open to anyone with a USB cable and the above "one-liner". `adb` is one of the platform tools in the android SDK. To get SMS messages: $ adb pull /data/data/com.android.providers.telephony/databases/mmssms.db ; sqlite3 -batch

Simple colourized JSON formatting for BASH
Leave out pygmentize or `pip install pygments` first.

Nicely display mem usage with ps
Nicely display mem usage with ps.

Remove a range of lines from a file
Deletes lines to of a file. You must put the end line first in the range for the curly brace expansion, otherwise it will not work properly.

download file1 file2 file3 file4 .... file 100

Delete leading whitespace from the start of each line
Removes any whitespace characters at the beginning of a line.


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: