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

show each new entry in system messages as a popup
It willl popup a message for each new entry in /var/log/messages found on the notify-send howto page on Posted here only because it is one of the favourites of mine.

Convert a Nero Image File to ISO
This line removes the 300k header from a Nero image file converting it to ISO format

benchmark web server with apache benchmarking tool
-n 9000 : Number of requests to perform for the benchmarking session -c 900 : Number of multiple requests to perform at a time

Getting a domain from url, ex: very nice to get url from squid access.log

Stream YouTube URL directly to MPlayer
A function for streaming youtube to mplayer. The option "-g" for youtube-dl tells it to output the direct video URL, instead of downloading the video. "-fs" tells MPlayer to go FullScreen, and "-quit" makes it less verbose. Requires: youdube-dl ( ) (Tested in zsh)

Connect via sftp to a specific port
I use this for connect via sftp to a server listening on a non default ssh port.

dd with progress bar and statistics
Uses the pv utility to show progress of data transfer and an ETA until completion. You can install pv via Homebrew on macOS

SVN Clean
Removes all unversioned files and folders from an svn repository. Also: $ svn status --no-ignore | grep ^I | awk '{print $2}' | xargs rm -rf will remove those files which svn status ignores. Handy to add to a script which is in your path so you can run it from any repository (a la '').

$python -c "DEV = '/dev/input/event4' #if event0 doesn't work, try event1 event2 etc fo = open(DEV) def interpret(keycode,state): if state == 0: print '%i up'%keycode if state == 1: print '%i down'%keycode if state == 2: print '%i repeat'%keycode while 1: line = if ord(line[10]) != 0: keycode,state = line[10],line[12] interpret(ord(keycode),ord(state)) "

Change your swappiness Ratio under linux
This command allow you to set the swappiness var at 50 (default is 60). The value interval must be set between 0 and 100. If swappiness is high=Swap usage is high, if swappiness is low=Ram usage is high.

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: