Saturday, October 9, 2010

Fun CLI uses

So if nothing we have learned that command line interfaces are not for novice users, very efficient, loved by CafeNinja and usually very boring and never any fun.

Well that isn't quite true.  I follow one my my favorite sites commandlinefu.com and have in the last few weeks seen some great fun uses of commands that can make anyone look to be a command line ninja with no further training.

The first command that I noticed makes use of a ncurses dialog box.  The command reads like this:
"dialog --gauge "Processing..." 6 40 36"  This defines a progress par that has reached 36 percent with the other numbers being the measure of the progress box.  This doesn't "do" anything, it is stuck in this way and uses no resources, but can make you look quite busy "processing" something.  It looks like the image I've put here.  You make it go away by just pressing Ctrl+C.


The next one make the screen just spew gibberish from the random number generator.  The only "problem" with this one is that it can drive even new processors to spike 100%, even worse than a run away flash page.  I added the "timelimit" command portion to prevent this running on a system that I'm not watching closely.  The command itself is 'cat /dev/urandom | hexdump -d |grep "25"', and will run crazy on your cpu.  My version is : 'timelimit -t120 cat /dev/urandom | hexdump -d |grep "25"'  This looks like this:


There are other commands that can actually make the progress bar count up like "for i in `seq 0 100`;do timeout 6 dialog --gauge "Install..." 6 40 "$i";done"  which like the first command is only making a dialog box that ins't really doing anything besides counting.  Look for your favorite and post them back here.  I bet we can make a small collection that if launched and run in an individual Terminator tab could always make you look diligent and beat the crap outta any "Boss key".

--
CafeNinja
Creative Commons License
This work is licensed under a Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

No comments: