select * from ideas

where topic='technical' and state='exploratory'

Command Line Wizardry

The command line is a powerfull tool. It harnessess the power to slice and dice data from and into the system, transforming it for the better.

The pragmatic programmer even devotes a tip on the use of the command line:

Every woodworker needs a good, solid, reliable workbench, somewhere to
hold work pieces at a convenient height while he or she works
them. The workbench becomes the center of the wood shop, the craftsman
returning to it time and time again as a piece takes shape.

For a programmer manipulating files of text, that workbench is the
command shell. From the shell prompt, you can invoke your full
repertoire of tools, using pipes to combine them in ways never dreamt
of by their original developers. From the shell, you can launch
applications, debuggers, browsers, editors, and utilities. You can
search for files, query the status of the system, and filter
output. And by programming the shell, you can build complex macro
commands for activities you perform often.

The Pragmatic Programmer Tip 21

I recently learned a new command which I find very usefull. The command is cut and it allows to cut a line of text along a delimeter and select a portion from it.

From the manpage for cut

The cut utility cuts out selected portions of each line (as specified
by list) from each file and writes them to the standard output. If no
file arguments are specified, or a file argument is a single dash
(`-‘), cut reads from the standard input. The items specified by list
can be in terms of column position or in terms of fields delimited by
a special character. Column numbering starts from 1.

For example the following command kills all the running java programs with one command.

ps -u dvberkel | grep java | cut -d ' ' -f 4 | kill -9