LinuxDevCenter.com

oreilly.comSafari Books Online.Conferences.

We've expanded our Linux news coverage and improved our search! Search for all things Linux across O'Reilly!

Search
Search Tips

advertisement

Listen Print Subscribe to Linux Subscribe to Newsletters

Linux and the Tools Philosophy
Pages: 1, 2

Here's an example, using two tools. The first tool, called who, outputs a list of users currently logged on to the system. The second tool is called wc, which stands for "word count"; it outputs a count of the number of words (or lines or characters) of the input you give it.



By combining these two tools, you can build a command to list the number of users currently on the system:

who | wc -l
4

The output of who is piped -- via a "pipeline," or a | character -- to the input of wc, which through use of the "-l" option outputs the number of lines of its input.

In this example, the number 4 is output, indicating that four users are currently logged on the system. Incidentally, piping the output of who to wc in this fashion is a classic tools example, and was called "the most quoted pipe in the world" by Andrew Walker in The Unix Environment, a book that was published in 1984.

Tools for today

Collective sets of tools designed around a certain kind of field or concept were called "workbenches" on older Unix systems; for example, the tools for checking the spelling, writing style, and grammar of their text input were part of the "Writer's Workbench" package.

Today the GNU Project publishes collections of tools under certain general themes, such as the "GNU text utilities" and "GNU file utilities," but the idea of "workbenches" are generally not part of the idiom of today's Unix-based systems. But, needless to say, we still use all kinds of tools for all kinds of purposes; in this series I've tried to show ways to use tools to efficiently get your work done on a Linux system.

You'll find that there's usually one tool or command sequence that works perfectly for a given task, but sometimes a satisfactory or even identical result can be had by different combinations of different tools -- especially at the hands of a Unix expert. (Traditionally, such experts were called "wizards.")

Some tasks require more than one tool or command sequence. And yes, there are tasks which require more than what these simple craft or hand tools can provide. Some tasks need more industrial techniques, which are currently provided for by the application programs. So we still haven't avoided applications entirely; at the turn of the millennium, Linux-based systems still have them, from editors to Web browsers. But our applications use open file formats, and we can use our tools on these files.

The invention of new tools has been on the increase along with the rise of Linux-based systems. At the time of this writing, there were a total of 1,190 tools in the two primary tool directories (/bin and /usr/bin) on my Linux system. These tools, combined with necessary applications, make free, open source software -- for perhaps the first time in its history -- a complete, robust system for general use.

Next week: Is "open source" just for software?

Michael Stutz was one of the first reporters to cover Linux and the free software movement in the mainstream press.


Read more Living Linux columns.




Tagged Articles

Be the first to post this article to del.icio.us

Sponsored Resources

  • Inside Lightroom
Advertisement

Sponsored by:

O'Reilly Media

©2009, O'Reilly Media, Inc.
(707) 827-7000 / (800) 998-9938
All trademarks and registered trademarks appearing on oreilly.com are the property of their respective owners.
About O'Reilly
Academic Solutions
Authors
Contacts
Customer Service
Jobs
Newsletters
O'Reilly Labs
Press Room
Privacy Policy
RSS Feeds
Terms of Service
User Groups
Writing for O'Reilly
Content Archive
Business Technology
Computer Technology
Google
Microsoft
Mobile
Network
Operating System
Digital Photography
Programming
Software
Web
Web Design
More O'Reilly Sites
O'Reilly Radar
Ignite
Tools of Change for Publishing
Digital Media
Inside iPhone
O'Reilly FYI
makezine.com
craftzine.com
hackszine.com
perl.com
xml.com

Partner Sites
InsideRIA
java.net
O'Reilly Insights on Forbes.com