The commands below are described in alphabetical order. Following those descriptions, some common usage of related commands is discussed. These commands are located in /usr/ucb.
See the list below for the commands available with the Source Compatibility Package.
Two versions of some commands exist: one in the default SunOS 5.x command location, and the other in the compatibility package found in /usr/ucb. The descriptions in this guide pertain only to the /usr/ucb versions, although, where relevant, the differences between the two versions are discussed.
Displays your machine architecture. arch uses the SunOS 5.x uname -m command. arch is not available in the default SunOS 5.x release.
Strips the full path name off a file. If you follow the path name with a suffix, that suffix is stripped, too:
$ basename /usr/src/rundog.c .c rundog $ |
basename is useful for writing shell scripts. This version parses arguments differently than the SunOS 5.x version.
Enables and disables immediate notification of the arrival of mail. When notification is enabled, biff displays the header and first few lines of mail messages when they are received. This command is not available in the default SunOS 5.x release.
This command is identical to the unbundled C compiler in /usr/ccs/bin/acc, except that the following directories are included:
User-specified include directories and libraries
The compatibility include files and directories
The default SunOS 5.x headers and libraries, if unresolved symbols remain
Compatibility package header files and libraries referenced by the compiler (cc) and linker (ld) are located in /usr/ucbinclude and /usr/ucblib.
Changes the owner of a file. This version allows you to optionally change the group as well. The group may be either a decimal group ID (GID) or a group name found in the GID file.
Displays the free disk space of currently mounted file systems. This command differs from /usr/bin/df in several ways:
Blocks sizes are reported in units of 1024-bytes in this version of df, while /usr/bin/df uses 512-byte blocks.
Perhaps the most obvious difference between the two versions of this command is their output format, as shown by the example below.
$ /usr/ucb/df Filesystem kbytes used avail capacity Mounted on /dev/root 1750592 826496 749032 52% / $ df / (/dev/root ): 231024 blocks 105323 files /proc (/proc ): 0 blocks 123 files |
Displays the number of disk blocks used by files in a directory. It is useful for seeing how disk space is being used. This version reports disk usage in kilobytes, while the default du command reports disk usage in blocks.
Echoes arguments to the standard output. This version and the default echo command recognize certain escape sequences differently.
Evaluates an expression. This version supports the following additional operators and keywords: match, substr, index, length().
Reboots your machine. This command is not available in the default SunOS 5.x release.
Halts your machine. This command is not available in the default SunOS 5.x release.
Determines the file type by examining the file's contents. This version supports symbolic links. When the -L option is specified for a file that is a symbolic link, file tests the file referenced by the link rather than the link itself.
Displays mail header information, including the sender and time the mail was received. This command is not available in the default SunOS 5.x release.
Displays the groups to which a user belongs. Although the id command in the default SunOS 5.x release has been enhanced to perform this function, groups is also available for compatibility.
Prints the numeric identifier (in hexadecimal) of the current host. This command is not available in the SunOS 5.x release.
Displays the name of your machine and allows you to rename it. This command is not available in the base release. uname -n in the SunOS 5.x release displays the machine name, but does not allow the super-user to rename the machine.
Installs files into a destination directory. This version has different options and syntax than the SunOS 5.x one.
This command is identical to the linker in /usr/ccs/bin/ld, except that it ensures that libraries in /usr/ucblib are linked in by ld, before the default SunOS 5.x libraries.
When unresolved symbols remain, the libraries in /usr/lib are referenced. Note that /usr/ucblib/libucb.so is always linked when this command is invoked.
Checks C programs for bugs, argument type errors, and potential portability problems. This command uses the lint libraries under /usr/ucblib.
Creates links to files or directories. The default ln removes an existing target if it has the requisite permissions. Because the SunOS 4.1 behavior is not obtained by default, the compatibility package contains a version of ln that does not remove an existing target.
Adds entries to a system log. Priorities, tags, and files to write to may be specified.
lpc, the line printer control program, is the same as in SunOS 4.1, except that it does not make use of the file /etc/printcap. Use lpc to start and stop a printer, disable or enable a spooling queue, rearrange the order of printing jobs, or display the status of each printer. This command is not available in SunOS 5.x.
Returns information on all print jobs on the local printer; however, for remote printers, it provides the status only for jobs belonging to the user. lpq is the equivalent of the SunOS 5.x command lpstat.
The command lpq username provides the status of all files, on all machines (both local and remote), belonging to the named user. In these examples, user wesson sends files fileX and fileY to the local printer printerA, and fileZ to a remote printer:
Sends files to the printer. The compatibility package version of lpr does not support the -r option (which removes a file after spooling it). Nor does it allow for specific fonts to be mounted on font positions 1, 2, 3, or 4. lpr is the equivalent of the SunOS 5.x lp command.
Removes files from the print queue. This is the SunOS 4.1 equivalent of the SunOS 5.x cancel command.
Produces a ripple pattern for testing printers.
Lists a file or the contents of a directory. The compatibility package version of ls differs from the default ls command in two ways:
The -l option does not print the group.
The -s option reports block sizes in blocks of 1024 bytes, instead of 512.
Reports the machine type. The SunOS 5.x uname -p command provides the same behavior. However, because many scripts and makefiles use mach, it has been placed in the compatibility package. This command is not available in default SunOS 5.x release.
Reads and sends mail messages. This command is a version of mailx(1) with defaults set to behave like the BSD mail command. See mailx(1) in the Solaris 8 Reference Manual Collectionfor complete information on the BSD default settings.
Creates a file of all error messages in a C program source file. This is useful for programs with a large number of diagnostic error messages. It reduces the size of the program, and the system overhead when running the program. This command is not available in the default SunOS 5.x release.
Reports the size of a page of memory in bytes. This is useful for scripts. This command is not available in the default SunOS 5.x release.
Graphics filters for various plotters. The following filters allow you to run plot on a variety of terminals: aedplot, atoplot, bgplot, crtplot, dumbplot, gigiplot, hp7221plot, hpplot, implot, plottoa, t300, t300s, t4013, t450, tek, and vplot.
Reports environment variables as currently set. It is similar to the env command. This command is not available in the default SunOS 5.x release.
Displays the status of the current processes. This version displays more information, in a different format, than that of the SunOS 5.x version.
Alters the nice value of running processes. This behavior is now present in the SunOS 5.x priocntl command; however, for SunOS 4.1 compatibility reasons, renice is included in the compatibility package. This command is not available in the default SunOS 5.x release.
SunOS 5.x These commands are similar to tput reset and tput init respectively; that is, they reset and set terminal-behavior characteristics. However they differ enough to be included here. reset and SunOS 5.x tset are not available in the default SunOS 5.x release.
Executes the given command and reports on the resource usage. rusage reports the total time elapsed (wall clock), the system CPU, the user CPU, plus 11 other fields in a one line summary following the commands output, if any. This command is not available in the default SunOS 5.x release.
/usr/ucb/sed is similar to /usr/bin/sed except it strips initial SPACE and TAB characters from text lines.
This version of shutdown allows you to specify a time and a warning message to be sent. It also sends shutdown messages to other systems if they have mounted filesystems from the machine being shut down. See the shutdown(1B) manual page for any limitations on SunOS 4.1 functionality.
The SunOS 5.x version of stty incorporates many of the features of SunOS 4.1 stty. The compatibility package version is included for full SunOS 4.1 functionality.
Calculates checksums in a machine-dependent way. Also, it displays the file in kilobytes instead of 512-byte blocks.
Evaluates conditional expressions. The SunOS 4.1 and SunOS 5.x versions of test differ with respect to the -f option. In the SunOS 4.1 release, this option means ``is the target not-a-directory?'' while in the SunOS 5.x release it means ``is the target a plain file?''.
Updates the access and modification times of a file. The SunOS 5.x version of touch does not support the -f option, which attempts to force the touch in spite of read and write permissions on the file.
Translates characters from the standard input to the standard output. There are two differences between /usr/bin/tr and this version:
In SunOS 4.1, when translating from string1 to string2, if string2 is shorter than string1, string2 is padded out to the length of string1 by repeating string2's last character.
This version does not require enclosing alphanumeric ranges inside square brackets.
See reset.
Creates symbolic links in /dev for SunOS 4.1 devices whose names are different in the SunOS 5.x release. When these links are no longer needed, they must be removed manually.
Displays a short list of logged-in users. This command is not available in the default SunOS 5.x release. The SunOS 5.x equivalent is who -q.
Edits the /etc/passwd file, and sets the appropriate locks. vipw runs consistency checks on the password file when the edits are complete and the locks have been removed. If these checks fail, vipw does not allow the incorrect file to be installed. This command is not available in the default SunOS 5.x release.
Locates the binary, source, and manual page files for the given command. whereis searches a standard list of common locations for these files. This command is not available in the default SunOS 5.x release.
Displays your effective user ID; whoami works even if you have used su to change your current user ID. This command is not available in the default SunOS 5.x release, although it is equivalent to id.