Commands by farazyashar (2)

  • Install the Linux kernel headers for currently running kernel version on Debian-based systems via apt-get Show Sample Output

    sudo apt-get install linux-headers-`uname -r`
    farazyashar · 2013-04-18 03:18:26 3
  • As of March 7, 2012: brew update - downloads upgraded formulas brew upgrade [FORMULA...] - upgrades the specified formulas brew outdated - lists outdated installations Note updating all packages may take an excruciatingly long time. You might consider a discriminating approach: run `brew outdated` and select specific packages needing an upgrade. For more information see homebrew's git repository: Show Sample Output

    brew update && brew upgrade `brew outdated`
    farazyashar · 2012-03-07 14:26:41 1

What's this? 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

download the contents of a remote folder in the current local folder

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

Suspend to ram
No need to be root to do that. Relies on UPower (previously known as DeviceKit-Power).

View network activity of any application or user in realtime
The "-r 2" option puts lsof in repeat mode, with updates every 2 seconds. (Ctrl -c quits) The "-p" option is used to specify the application PID you want to monitor. The "-u' option can be used to keep an eye on a users network activity. "lsof -r 2 -u username -i -a"

Display text as though it is being typed out in real time
Pipe Viewer allows you to monitor the progress of a data transfer or command, or to show the time elapsed, among other things. In this use, it limits the transfer rate of the echo command to 10 bytes per second, making your text appear to be typed out in real time as in Hollywood movies. Fun!

find out how much space are occuipied by files smaller than 1024K
The command gives size of all files smaller than 1024k, this information, together with disk usage, can help determin file system parameter (e.g. block size) or storage device (e.g. SSD v.s. HDD). Note if you use awk instead of "cut| dc", you easily breach maximum allowed number of records in awk.

background a wget download

Create a new file

Title Case Files
All words of the filenames except "a", "of", "that" and "to" are capitalized. To also match words which begin with a specific string, you can use this: $ rename 's/\b((?!hello\b|t)[a-z]+)/\u$1/g' * This will capitalize all words except "hello" and words beginning with "t".

List your interfaces and MAC addresses
Requires sysfs mounted on /sys - may only be useful for Linux systems. Could also use "printf '%-8s %s\n' $(basename $f) $(cat $f/address)" instead of echo.

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.


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: