Commands by hunterm (8)

  • Generates a password using symbols, alpha, and digits. No repeating chars. Show Sample Output


    -4
    for i in {21..79};do echo -e "\x$i";done | tr " " "\n" | shuf | tr -d "\n"
    hunterm · 2011-04-14 01:43:40 7

  • 0
    find $(echo "$PATH" | tr ':' ' ') -name "*program*"
    hunterm · 2011-01-07 22:27:44 5
  • RTFMFTW.


    42
    rtfm() { help $@ || man $@ || $BROWSER "http://www.google.com/search?q=$@"; }
    hunterm · 2011-01-05 02:53:38 323
  • Yep, now you can finally google from the command line! Here's a readable version "for your pleasure"(c): google() { # search the web using google from the commandline # syntax: google google query=$(echo "$*" | sed "s:%:%25:g;s:&:%26:g;s:+:%2b:g;s:;:%3b:g;s: :+:g") data=$(wget -qO - "https://ajax.googleapis.com/ajax/services/search/web?v=1.0&q=$query") title=$(echo "$data" | tr '}' '\n' | sed "s/.*,\"titleNoFormatting//;s/\":\"//;s/\",.*//;s/\\u0026/'/g;s/\\\//g;s/#39\;//g;s/'amp;/\&/g" | head -1) url="$(echo "$data" | tr '}' '\n' | sed 's/.*"url":"//;s/".*//' | head -1)" echo "${title}: ${url} | http://www.google.com/search?q=${query}" } Enjoy :) Show Sample Output


    -7
    The command is too big to fit here. :( Look at the description for the command, in readable form! :)
    hunterm · 2011-01-05 02:45:28 7
  • The command was too long for the command box, so here it is: echo $(( `wget -qO - http://i18n.counter.li.org/ | grep 'users registered' | sed 's/.*\<font size=7\>//g' | tr '\>' ' ' | sed 's/<br.*//g' | tr ' ' '\0'` + `curl --silent http://www.dudalibre.com/gnulinuxcounter?lang=en | grep users | head -2 | tail -1 | sed 's/.*<strong>//g' | sed 's/<\/strong>.*//g'` )) This took me about an hour to do. It uses wget and curl because, dudalibre.com blocks wget, and wget worked nicely for me. Show Sample Output


    -1
    Check the Description below.
    hunterm · 2010-10-07 04:22:32 3

  • 0
    curl --silent http://www.dudalibre.com/gnulinuxcounter?lang=en | grep users | head -2 | tail -1 | sed 's/.*<strong>//g' | sed 's/<\/strong>.*//g'
    hunterm · 2010-10-07 04:12:45 3

  • -1
    wget -qO - http://i18n.counter.li.org/ | grep 'users registered' | sed 's/.*\<font size=7\>//g' | tr '\>' ' ' | sed 's/<br.*//g' | tr ' ' '\0'
    hunterm · 2010-10-07 03:19:17 4
  • Output the html from xkcd's index.html, filter out the html tags, and then view it in gwenview. Show Sample Output


    -1
    gwenview `wget -O - http://xkcd.com/ | grep 'png' | grep '<img src="http://imgs.xkcd.com/comics/' | sed s/title=\".*//g | sed 's/.png\"/.png/g' | sed 's/<img src=\"//g'`
    hunterm · 2010-08-24 22:21:51 4

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

List .log files open by a pid
Uses lsof to display the full path of ".log" files opened by a specified PID.

Lists the supported memory types and how much your board can support.

generate iso

Reset terminal that has been buggered by binary input or similar

pngcrush all .png files in the directory
Nothing too magical here, just uses pngcrush to losslessly compress all your pngs!

Prints line numbers
If you don't have nl on your system, this achieves a similar effect, the default behavior in nl is to not number blank lines, but this does.

Find default gateway

mail with attachment
An easy one but nice to keep in mind.

list block devices
Shows all block devices in a tree with descruptions of what they are.

Getting the last argument from the previous command


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: