For some the command line interface is a dreadful place. It is a large
black box that stares at them, forming some kind of singularity iside
there computer screen. A black hole that sucks up their confidence and
renders there mouse pointer obsolete and spews fountains of doubt. When
you think of the people who use the command line on a daily basis
and the magic they do inside that little black box, its not hard to be
impressed , or terrified. Seeing lines of code scroll by while rakatack
keyboard strokes perfume the office air with a tang of magic, one would
think coders can re-write the DNA of the universe in there. But it does
not have to be so complicated. Thecommand line is a tool, a means, not
a goal. It may be a very ‘"geeky" way to do things and offer up some
interesting ways of working with computers (over a terminal connection
like SSH or on the command line of an underpowered system), but some
tasks areactually more productive when done via the command line.
recent months I have found myself looking for an equilibrium between
web based applications, Applications installed on my desktops ( On the
Graphical user interface) and applications I use via the command line.
The trick here is not to ‘choose’ but ‘combine’. There are things
better done in the cloud , others are better to work with when using an
installed application via the GUI, and others are better suited to do
via the command line. Sure an application like "newsbeuter" will give you a command-line interface to your RSS
feeds, but Google reader is more productive. Sure there are plenty of
cloud-based imaging-manipulation sites , but nothing beats a Picasa.
Sure its nice to unrar 40 or so files using Winrar , but you can’t beat doing it via the command line.
A couple of gems I have found while using the command line make my life a lot easier. Tasks that take a lot of mouse clicks when I would have to do them in a graphical user interface like downloading a whole lot of Rar files. Ok there are plenty of download managers but none of them really work right , or it takes too long to find out just how they work. The simplicity of the WGET command (and the addition of the right switch to have Wget download ALL the url’s specified in a textfile)
is just simple and downright awesome. In addition to the ‘screen’
command (that lets the downloads run in the background even when you
disconnect your terminal session) AND the addition of a "bandwith cap" switch (that stops the downloads of eating up ALL your band-with) you can realy have your linux machine "work for you’ in the background while you do other things.
Also when it comes to "unpacking" those files its great to use the unrar-x command to do it all. With the addition of the right switches (Google around or ask your Linux-related chatroom buddies on IRC) you can easily tell your system to unpack ALL of the rar files in your directory and throw out the .rar files after extraction. No clicks required.
But one of the gems that stuck this week, is one I found on Command-line Fu. It enables you to extract the audio from a videofile
and turn it into an mp3. I have been looking for AGES for something
that does this on the mac OR on windows. Downloaded lots of tools but
none of them worked. Sure something like ‘wiretap studio’ or "soundflower" would let me "capture" the audio-stream..
But then i would have to sit there , watch the video while the audio
was recording. This way I feed the file into the command line terminal
and get an MP3 sito-presto.
The advantage ? Now i can turn some movies I love into audio files , so
i can have my own little "audible" audio-drama collection to listen to
in the car.
Summary ? the command line is a tool and works
some some things, but not for others. My suggestion when you are
looking to let technology work for you : Ask the question WHAT you want
to do and THEN figure out the best way to do it ( Cloud / Gui / Cli) and not the other way around.
Wget command to download all the links from the file downloads.txt :
wget -c –limit-rate=1500k -i "downloads.txt"
Command to unrar ALL the files in your directory that *part1.rar" in their filename :
for a in *part1.rar; do unrar x "$a"; done
Extract audio from the videofile.
( first do a sudo apt-get install mencoder )
mencoder -of rawaudio –ovc copy –oac mp3lame -o output.mp3 input.avi