You are on page 1of 12

Module 2

Using Command-Line Features and Online Help Resources

Objectives
Upon completion of this module, you should be able to:
Construct and execute commands from the command line Use online documentation

Constructing and Executing Commands From a Command Line

The following are reviewed:


Introducing command-line syntax Entering multiple commands on a single command line Control characters

Command-Line Syntax
You can change the behavior of command functions by using options and arguments, as shown in the following table.

Use commands: uname,date,cal,clear Use commands with options:uname i, uname sr, uname -a Use commands with arguments: cal 7 2009 Use commands with options and arguments: ls, ls l, ls l /etc

Entering Multiple Commands on a Single Command Line


You can enter multiple commands on a single command line by using a semicolon (;) to separate each command. Example: $ date;uname $ cal 12 2009; date; uname -rs The shell recognizes the semicolon as a command separator.

Using Online Documentation


The Solaris OS provides online manual pages,which describe commands and their usage. This section reviews:
Displaying the online manual pages Scrolling in man pages Searching the man pages

Displaying the Online Manual Pages


The online UNIX Reference Manual (man) pages provide detailed descriptions of UNIX commands and how to use them. The syntax of the man command is: man command man option command man option filename Example: $ man uname Use the man command to display the man page entry that explains a given command.

Scrolling in Man Pages


This table shows the keys on the keyboard that you use to control the scrolling capabilities when you are in the man pages.

Searching the Man Pages


There are two ways to search for information in the man pages:
Search by section:
The online man-page entries are organized into sections based on the type or use of the command or le. For example, Section 1 contains user commands, while Section 4 contains information about various le formats. Syntax: man -s number command Example:
$ man -l passwd passwd (1) -M /usr/man passwd (4) -M /usr/man $ man -s 4 passwd Reformatting page. Please Wait... done

Using Online Product Documentation


To start a web browser in the desktop environment, click the clock icon located on the front panel.

To access comprehensive information on Sun products, visit the Web site http://docs.sun.com using your web browser.

The docs.sun.comWeb Site

Exercise: Using Command-Line Features


Objectives Tasks Discussion Solutions

You might also like