2.1. Introduction

 < Day Day Up > 

This chapter presents the Unix commands of interest to users and programmers. Most of these commands appear in the "Commands" section of the online manual. With rare exception, this book purposely avoids system administration commands, because system administration is beyond its scope. The focus instead is on everyday commands, those used both interactively and for programming.

Summarizing three operating systems that are similar but not identical is a daunting task. In order to make a coherent presentation, the chapter is organized as follows:


Common Commands

This section lists commands that should be available on just about any Unix system. We have included here many commands that are downloadable from the Internet and that are standard with GNU/Linux, such as autoconf or wget, even though they may not come "out of the box" on commercial Unix systems. Wherever possible, we provide a URL from which the source to the command may be downloaded, so that you can build the program yourself if you want it. See the section "Obtaining Compilers" in Chapter 1 for what to do if you don't have a C compiler for your system.

Additionally, we have made an effort to be as concise as possible. For example, GNU-style long options are listed side-by-side with their standard single-letter counterparts. Similarly, several commands have associated with them additional more specialized commands that are needed only rarely. We simply list such commands as "related," without giving them separate entries. For such commands, you should then see your system's online manual pages or other documentation.


Solaris Commands

This section lists the important commands that are available only on Solaris.


GNU/Linux Commands

This section lists the important commands that are available only on GNU/Linux.


Mac OS X Commands

This section lists the important commands that are available only on Mac OS X.


Java Commands

The primary commands for doing Java development. These are (essentially) the same across all systems.

Even commands that appear in the section "Alphabetical Summary of Common Commands" are not identical on all systems. Thus, here too we've made an effort to describe the common behavior first, with additional subsections on system specific behavior. This occurs most frequently for the different options that different versions of the commands accept.

In the command summaries, each entry is labeled with the command name on the left-hand edge of the page. The syntax line is followed by a brief description and a list of all available options. Many commands come with examples at the end of the entry. If you need only a quick reminder or suggestion about a command, you can skip directly to the examples.

Some options can be invoked only by a user with special system privileges. Such a person is often called a "superuser." This book uses the term privileged user instead.

Typographic conventions for describing command syntax are listed in the Preface. For additional help in locating commands, see the Index.

2.1.1. Finding Commands on Solaris

Solaris systems provide a number of "bin" directories underneath /usr for different kinds of commands. For example, /usr/bin holds most regular commands, /usr/java/bin has the Java commands, and so on. The bin directories are summarized in Table 2-1.

Table 2-1. Solaris bin directories

Directory

Purpose

/bin

Symbolic link to /usr/bin

/sbin

System administration commands

/usr/sbin

More system administration commands

/usr/bin

Regular commands

/usr/X/bin

X Window System utilities

/usr/ccs/bin

C Compilation System: compiler-related programs

/usr/dt/bin

Common Desktop Environment (CDE) programs

/usr/java/bin

Java programs

/usr/openwin/bin

OpenWindows programs

/usr/perl5/bin

The perl command and its related programs

/usr/sfw/bin

Additional software from the Internet

/usr/ucb

Berkeley Unix compatibility programs

/usr/xpg4/bin

Standards-compliant versions of regular utilities

/usr/xpg6/bin

More standards compliant versions of regular utilities


We strongly recommend placing /usr/xpg6/bin and /usr/xpg4/bin in your shell search path before the other directories. Solaris is unique among modern Unix systems in that the versions in /usr/bin continue to be the original System V Release 4 versions of the commands. Today, with just about every other system being POSIX compliant, you should set up your Solaris account to be POSIX compliant too! For Bash or the Korn shell, use something like this in your .profile file:

     # Use multiple lines to fit on the page:     PATH="/usr/xpg6/bin:/usr/xpg4/bin:/usr/ccs/bin:/usr/bin:/usr/java/bin"     PATH="$PATH:/usr/sfw/bin:/usr/perl5/bin"     PATH="$PATH:/usr/dt/bin:/usr/X/bin:/usr/openwin/bin"

The Solaris Software Companion CD contains unsupported copies of many popular Free Software and Open Source programs from the Internet. They install under /opt/sfw. If you install this software, you may wish to add /opt/sfw/bin to your path as well.

2.1.2. Finding Commands on GNU/Linux and Mac OS X

The situation on GNU/Linux and Mac OS X is considerably simpler. For both systems, a path like the following suffices:

     PATH=/bin:/usr/bin:/usr/X11R6/bin

On Mac OS X the default path is /bin:/sbin:/usr/bin:/usr/sbin. You may wish to add the X11 directory to it:

     PATH=$PATH:/usr/X11R6/bin

Essentially every GNU/Linux program accepts long options (such as --fire-phasers) besides the traditional short ones (-F). In addition, just about every GNU/Linux program accepts the options --help and --version, to print a command-line summary and version information respectively. In the interests of brevity, the individual command descriptions omit the --help and --version options, and they omit the statement that long options apply only to GNU/Linux programs.


     < Day Day Up > 


    Unix in a Nutshell
    Unix in a Nutshell, Fourth Edition
    ISBN: 0596100299
    EAN: 2147483647
    Year: 2005
    Pages: 201

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net