Commands by onetom (1)

  • It runs on Mac OS X since it has curl installed by default. On Linux the easiest is to install curl, but wget -qU "Mozilla" "http..." will work too. It's important to specify the currencies in capital letters, or use sed -n "s/.*>\(.*\) `echo $3 | tr '[a-z]' '[A-Z]'` sed -n "s/.*>\(.*\) $3 Show Sample Output


    0
    xe(){ curl "http://www.xe.com/wap/2co/convert.cgi?Amount=$1&From=$2&To=$3" -A "Mozilla" -s | sed -n "s/.*>\(.*\) $3<.*/\1/p";}
    onetom · 2011-02-12 12:08:14 9

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

I finally found out how to use notify-send with at or cron
The simplest way to do it. Works for me, at least. (Why are the variables being set?)

Add to Instapaper
Adds URL to Instapaper. Usage: instapaper-add user@example.com 12345 http://www.commandlinefu.com/

zsh only: access a file when you don't know the path, if it is in PATH
Say you want to execute 'file' on the command 'top' (to determine what type of file it is); but you don't know where 'top' resides: preface the argument with = and zsh will implicitly prepend the path.

Find processes stuck in dreaded "D" state aka IO Wait
Lots of fun to run on nfs clients when the server or network connection is having issues

List the size (in human readable form) of all sub folders from the current location

disassemble binary shellcode
The options -b binary and -m are needed for disassembling raw machine code when it is not part of a full binary executable with proper headers.

Convert CSV to JSON with miller
Using the csv tool `miller` you can transform a csv file into a json array of objects, where the properties are the values of the csv header line and the values are the values of the subsequent lines.

Generate SHA1 hash for each file in a list
All output is placed in file SHA1SUMS which you can later check with 'sha1sum --check'. Works on most Linux distros where 'sha1sum' is installed.

Quickly move the cursor to different parts of the command line based on a mark.
Use 'ctrl-@' to set a mark. See the first comment for a better explanation.

using scanner device from command line
you have to replace "mustek_usb" with the scanner found by `scanimage -l`


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: