LinuxLinks.com
Newbies What Next ? News Forums Calendar

Search





News Sections
Home
General News (3972/0)
Reviews (626/0)
Press Releases (464/0)
Distributions (187/0)
Software (807/0)
Hardware (522/0)
Security (192/0)
Tutorials (337/0)
Off Topic (180/0)


User Functions
Username:

Password:

Don't have an account yet? Sign up as a New User


Events
There are no upcoming events



CLI Magic: One-liners   
Monday, March 21 2005 @ 05:00 PM EST
Contributed by: glosser

Linux.com presents the next tutorial in their command-line series. This one is on apropos and grep.

Newcomers to Linux often feel overwhelmed by the number of commands at their disposal. Frustration sets in when they know what they wish to accomplish, but they do not have any idea what command(s) they can use to get the job done. This week's CLI Magic -- written by Jim Westbrook -- helps clear away some of that excess one-liner at a time.

Fortunately, Linux provides a couple of utilitites which use a database of the man pages to point them to an appropriate command or provide a hint of what a command does. These are apropos and whatis respectively. An example may be the best illustration of their use. First one for apropos:

~/> apropos music
SDL::Music (3pm) - a perl extension
tse3play (1) - play/convert music files (MIDI or TSE3MDL) using
the TSE3 sequencer engine library

The output results are not particularly useful if what the user desires is to learn how to play a music CD on his system. The next logical step is to call apropos again, this time looking for the string "CD" instead of music. Alas, the result of this request returns 76 lines which is almost as overwhelming as the full list of commands in /bin. What the user needs is a way to limit the results to only those items that include the word "play" in the description. Thankfully, Linux provides just such a tool -- grep.

Full tutorial

  [ Views: 1350 ]  


CLI Magic: One-liners | 0 comments | Create New Account
The following comments are owned by whoever posted them. This site is not responsible for what they say.
No user comments.


What's Related
  • Full tutorial
  • More by glosser
  • More from Tutorials


  • Story Options
  • Mail Story to a Friend
  • Printable Story Format


  • We have written a range of guides highlighting excellent free books for popular programming languages. Check out the following guides: C, C++, C#, Java, JavaScript, CoffeeScript, HTML, Python, Ruby, Perl, Haskell, PHP, Lisp, R, Prolog, Scala, Scheme, and SQL.

    Built with GeekLog and phpBB
    Comments to the webmaster are welcome
    Copyright 2009 LinuxLinks.com - All rights reserved