Saturday, October 3, 2009

The Linux Command Line - Third Draft Now Available

The third draft is now available. This version features reformatted and captioned tables, some of the changes suggested by the review team (more to follow), and a number of small additions. It also includes the edited versions of the first 18 chapters.

If you are working on the review, please switch to this version. The new draft, named TLCL-09.10.pdf, is available here.

Thanks for your help!

Friday, August 14, 2009

The Linux Command Line - Second Draft Now Available

Hi Everyone,

I just posted the second draft of my book. This incorporates items from my "to do" list. It does not yet include any changes from the review team. Reviewers may switch to this version if they wish (just indicate that you are reviewing version 09.08 of the book) but may also continue with the first draft. The changes in this version are not extensive but it should read a little better. A few new items were added, and the table of contents now provides links to the individual chapters making navigation somewhat easier. Enjoy!

The new PDF is named TLCL-09.08.pdf and is available here.

Wednesday, July 22, 2009

I'm Looking For Reviewers

Sorry about my long absence, but as you will see, I have an excuse:

Hello All,

I have just finished the first draft of a book I'm writing titled, "The Linux Command Line" to be released under a Creative Commons license. With the initial writing completed, it's time for some editing and review. That means I'm looking for folks willing to perform some reviewing. In particular, I need technical reviewers who can gently point out my technical and historical errors, and I need less experienced users who can find areas where my explanations are unclear. Don't worry about grammar and spelling and such, I have a "real" editor for that. At this stage I need gurus and sample users to test this thing.

The book is fairly long (about 475 pages) so a good review will take some time and effort on the part of any volunteers. If you make a serious contribution, I will add your name to the list of contributors in the "Acknowledgments" section of the first chapter. Don't laugh, that's all I got for doing a technical review on O'Reilly's "Bash Cookbook."

Unlike Bash Cookbook however, my book will be freely distributable in PDF format but I am reserving the right to sell printed versions.

Please feel free to take a look at the draft. It can be downloaded from my Sourceforge site at:

http://downloads.sourceforge.net/sourceforge/linuxcommand/TLCL-09.07.pdf?use_mirror=master

If you decide that you'd like to help out with the review, let me know and I will provide further details.

Many thanks!

Thursday, April 9, 2009

"We're Linux" Video Finalists

The Linux Foundation has announced the finalists in their "We're Linux" competition. While I consider all the entries rather weak, my favorite is this one:

Project: Building An All-Text Linux Workstation - Part 7

Today, we will finish up with printing by taking a look at the command line tools provided by CUPS.

CUPS supports two different families of printer tools. The first, Berkley or LPD comes from the Berkley Software Distribution (BSD) version of Unix and the second is SysV from the System V version of Unix. Both families include comparable functionality, so choosing one over the other is really a matter of personal taste.

Setting A Default Printer
A printer can be set as the default printer for the system. This will make using the command line print tools easier. To do this we can either use the web-based interface to CUPS at http://localhost:631 or we can use the following command:

lpadmin -d printer_name

where printer_name is the name of a print queue we defined in Part 6 of the series.

Sending A Job To The Printer (Berkley-Style)
The lpr program is used to send a job to the printer. It can accept standard input or file name arguments. One of the neat things about CUPS is that it can accept many kinds of data formats and can (within reason) figure out how to print them. Typical formats include PostScript, PDF, text, and images such as JPEG.

Here we will print a directory listing in three column format to the default printer:

ls /usr/bin | pr -3 | lpr

To use a different printer, append -P printer_name to the lpr command. To see a list of available printers:

lpstat -a

Sending A Job To The Printer (SysV-Style)
The SysV print system uses the lp command to send jobs to the printer. It can be used just as lpr in our earlier example:

ls /usr/bin | pr -3 | lp

however, lp has a different set of options. For example to specify a printer, the -d (for destination) option is used. lp also supports many options for page formatting and printer control not found with the lpr command.

Examining Print Job Status
While a print job is being printed, you may monitor its progress with the lpq command. This will display a list of all the jobs queued for printing. Each print job is assigned a job number that can be used with to control the job.

Terminating Print Jobs
Either the lprm (Berkley) or cancel (SysV) commands can be used to remove a job from a printer queue. While the two commands have different option sets, either command followed by a print job number will terminate the specified job.

Getting Help
The following man pages cover the CUPS printing commands

lp lpr lpq lprm lpstat lpoptions lpadmin cancel lpmove

In addition, CUPS provides excellent documentation of the printing system commands in the help section of the online interface to the CUPS server at:

http://localhost:631/help

Select the "Getting Started" link and the "Command Line Printing And Options" topic.

A Follow Up On Part 4
Midnight Commander allows direct access to its file viewer and built in text editor. The mcview command can be used to view files and the mcedit command can be used to invoke the editor.

Further Reading

Other installments in this series: 1 2 3 4 5 6 7 8 9 10 11 12 13 14