INTRO(0)
NAME
intro - introduction to the DG/UX System
PURPOSE
This introduction provides an overview of DG/UX system user
commands and application programs. It divides the DG/UX
facilities up into groups that reflect how users' needs are
divided.
The Outline shows how the commands and programs are categorized.
The Functional Group Summary section explains the categories and
the kinds of user needs that they represent, with a quick mention
of each command in that category. The DG/UX System Map section
lists the DG/UX commands under each category along with a brief
description of what they're primarily used for. Since many
commands have several options (and therefore many different
uses), we give only a brief description of what the commands do.
The commands and application programs appear without their
chapter identifiers, since all of them are in Chapter 1. The
reference pages for each command appear after the Permuted Index,
in alphabetical order.
DG/UX 4.00 Page 1
Licensed material--property of copyright holder(s)
INTRO(0)
OUTLINE
OPERATORS
Redirected input and output
PROCESS CONTROL
FILE MANIPULATION
Looking at files
Listing, moving, and deleting files
Making ad hoc databases from files
Manipulating lines
Converting and paginating files
Comparing files and directories
NUMBER TOOLS
SOFTWARE DEVELOPMENT
Source Code Control System
Languages and support
Archive and library tools
Shell tools
USER ENVIRONMENT
Getting help
Where you are in the file system
Mail and messages
Reminder services
File security
SYSTEM MANAGEMENT
Administration
Security
TEXT MANIPULATION
PERIPHERAL DEVICE MANAGEMENT
NETWORKING
OTHER TOOLS
DG/UX 4.00 Page 2
Licensed material--property of copyright holder(s)
INTRO(0)
FUNCTIONAL GROUP SUMMARY
The functional group titles appear below, with corresponding
models of the way users probably think about the system. It is
not a complete definition of the system, since many DG/UX system
commands are general, versatile, and resistant to categorization.
The summary gives a new user a useful approach to the DG/UX
world. For both users and programmers, it provides a map of the
system's capabilities in terms of their probable needs, rather
than in terms of the system's abstract capabilities.
OPERATORS
In arithmetic, an "operator" is one of the "signs" (like +, -,
/, and *). It stands for an action to be performed upon the
numbers that surround it. In the DG/UX system, the shell has its
own operators. However, the operators don't perform actions on
numbers; they perform actions on files or parts of files. Shell
operators mean nothing by themselves, but when used with commands
they contribute much to the computing power available to you. A
full explanation of shell operators is in sh(1); here are a few
that are used often in the command line.
Redirected input and output
Many commands take input from the standard input and write their
output to the standard output. The standard input's default is
usually the keyboard; the standard output's default is your
terminal. For example, if you type ls<newline> at the keyboard
(standard input), the shell will print the list of files in the
current directory on your screen (standard output). However,
input and output can be redirected; i. e., made to come from or
go to somewhere else than the default. The following statements
on a command line redirect input and output.
>file Sends the output from a command into a file.
Example: ls >contents sends the names of all the
files in the current directory into the file
contents. If the file already exists, its contents
are destroyed and then replaced by the new material.
>>file Like >, but if the file already exists, the new
material is appended to the end of the file.
<file Take input from a file. For an editor that reads the
standard input (like ed), this means that a series
of editing commands can be stored in a file and then
executed with ed <commandlist file.
<<eofstring Take input from the standard input until the
DG/UX 4.00 Page 3
Licensed material--property of copyright holder(s)
INTRO(0)
eofstring is entered on a line by itself. When you
invoke this on a command line, the shell will prompt
you for input. The program taking the input will
continue until you type the end-of-input-file
character that you specified in eofstring.
command1 | command2 ...
The pipeline: takes the standard output of the
command on the left of the pipe and makes it the
standard input of the command on the right of the
pipe. Pipelines can be chained. Example: ls | wc
-l takes the list of files in your current directory
(ls) and counts them by line (wc -l), thus
returning to you the number of files in your current
directory.
PROCESS CONTROL
Everything that happens in DG/UX is part of a process. That
includes the existence of users, because the user interface to
DG/UX is the shell program that runs in a separate process for
each user. Commands often are programs themselves, so they run
in separate processes.
Commands can give information on processes or control them. For
example, id, who, and tty tell you what user, process, or
terminal you are on the system. Who, tells you who else is on
the system and ps tells you what programs or commands are they
running. Kill lets you stop one of your own programs or long
commands; nice lets you run it at a low priority.
FILE MANIPULATION
This group of commands is one of UNIX's most useful features.
Their versatility is enhanced by input and output redirection,
and by pipelining (see Operators, above).
Looking at files
You look at the contents of your files with cat, which types the
files onto your screen. It can also concatenate several files
into one file, with output redirection. If you want to put the
output of a command into a file and look at it at the same time,
you just pipeline the output through tee.
If you use more instead of cat, you can control how much of the
file is typed; for example, you could peruse the file a screenful
at a time. Head types only the first few lines of a file; tail
types the last part of a file, beginning at any line you specify.
DG/UX 4.00 Page 4
Licensed material--property of copyright holder(s)
INTRO(0)
Listing, moving, and deleting files
To look at the list of files in the current directory, you use
ls; you can specify options to see information about the files,
including when they were created and how big they are the number
of characters in them. Renaming files and directories is done
with mv, which can also move files and directories to other
directories. To copy files, use cp. Files can be linked with ln,
and deleted with rm. Directories are created with mkdir and
removed with rmdir.
Searching for files and patterns
If you aren't sure what directory a file is in, find will tell
you its pathname. You can search one or more files for a pattern
(a word, string, or other group of characters) with grep.
Ad hoc databases from files
When used together, these commands let you manipulate files in
much the same way that a database does. They rely on a consistent
way of separating information that appears in each line of a
file. Cut will cut out specified fields from each line in a file
(say the third word) and send them to the standard output; paste
puts corresponding lines in two files together. Join forms a
join of two relations specified by corresponding lines of two
sorted files. Awk, a pattern-scanning language described in Text
Manipulation, can generate reports using the information in a
"database" file.
Line-by-line manipulation
Files can be sorted by line with sort; identical lines can be
rooted out with uniq. You can get a count of the number of
characters, words, and/or lines in a file with wc. Files can be
split in specified ways with split and csplit.
File conversion and pagination
Raw files can be paginated for output with pr. There is a
program that will translate from one character code scheme to
another (example: EBCDIC to ASCII), dd, and one that will
translate characters in any way you wish, tr. Col filters
reverse formfeeds and backward printer motion from files that you
want to print on simple lineprinters. Touch changes the time and
date of last modification to the current time and date.
Comparing files and directories
You can find out where two files differ cmp, or where they differ
and how to make them the same diff-diff3 for three files. You
DG/UX 4.00 Page 5
Licensed material--property of copyright holder(s)
INTRO(0)
can produce a file that marks changes to a file diffmk, and one
that lists, in three columns, what lines are unique to each of
two files and what lines they have in common. You can use dircmp
to compare the file listings of two directories.
NUMBER TOOLS
DG/UX provides an interactive arithmetic language bc based on a
calculator dc, an interactive unit-conversion program units, and
a program that will factor numbers factor. Dc uses reverse
Polish notation (as do Hewlett-Packard calculators). It and bc
can use any base to calculate to an arbitrary precision.
SOFTWARE DEVELOPMENT
DG/UX supports the following programming languages and tools.
SCCS
The Source Code Control System (SCCS) is a development tool for
tracking and documenting the development of large software
projects. Special procedures let you create (admin), access (get,
unget), change (delta, cdc), search (what), compare (sccsdiff),
print (prs), and validate (val) source code files. There is also
a command to let you see who might be preparing to change parts
of the code just as you're about to examine it (sact). SCCS puts
multiple versions of code in order, and provides the means to
maintain them.
Languages & support
DG/UX provides extensive support for C, partially because much of
the system is written in it. There is a compiler (cc) and a
preprocessor (cpp). Also included are a regular-expression
compiler (regcmp), a compiler-compiler (yacc), a lexical analyzer
(lex), a source-code syntax checker (lint), and an external-
reference flowgraph generator (cflow). A "beautifier" (cb)
automatically indents and spaces code into an easy-to-read
format. The cross-reference generator is called cxref.
There is also an assembler language (as) and a string-
manipulation language (sno, a slightly modified SNOBOL). Other
languages are available as separate products (e.g., Pascal (pc),
FORTRAN 77 (f77)).
Tools include a source-level debugger (dbx), a symbolic debugger
(mxdb), a link editor (ld), a dump command (od), and a version-
control mechanism (vc).
DG/UX 4.00 Page 6
Licensed material--property of copyright holder(s)
INTRO(0)
Archive & library tools
Archives can be created and maintained with ar and copied in and
out with cpio. A topological sort with tsort will order the
library archive file.
Shell tools
The shell, a program that is used as the command line
interpreter, can also serve as a programming language. Any DG/UX
command can be executed in a shell "script" or program. A number
of commands are seldom used except in shell scripts: expr, which
evaluates its arguments; getopt, which parses command options;
line, which reads a line from the standard input; echo, which
sends its arguments to the standard output; true and false, which
simply generate return codes without doing anything; test, which
evaluates conditions (such as Boolean expressions); and basename
and dirname, which return the base and directory parts of a
pathname, respectively.
A terminal usually can access only one process at a time, but
with shl, a "shell layer manager," you can create and run several
shell processes (each running its own program(s)). This is also
known as virtual-terminal management. With pipelines, output from
one command can be passed as input to another; xargs makes a
command treat input as arguments rather than raw input. Shell
scripts are subject to efficiency evaluations; with time, a shell
script author can find out how much system time it takes to run a
given script (it will also time regular commands). A process can
be forced to wait for its background processes to finish with
wait; a process can be paused with sleep.
USER ENVIRONMENT
Your user environment is much like your office. In your business,
your location, calendar, telephone, and access to information are
parts of the office environment; they have analogues in a DG/UX
user environment.
Getting help
One other factor in your work environment is the knowledge of
where to turn for help. In DG/UX, help can briefly explain
commands and error messages. For more extensive on-line
information, you can turn to man, which prints sections from this
manual, the Programmer's Reference for the DG/UX (Trademark)
System, or the System Manager's Reference for the DG/UX
(Trademark) System.
Where you are in the file
DG/UX 4.00 Page 7
Licensed material--property of copyright holder(s)
INTRO(0)
Your location refers to the current directory; what you can do at
any given time depends in part on this location in DG/UX's file
system. You can find out where you are with pwd; it prints the
full pathname of the current working directory. You can go other
places in the filesystem with cd; it changes the working
directory.
Mail and messages
You are known to an electronic mail system in DG/UX; use mail to
send and read mail. Brief messages can be passed with write; you
can control whether you receive messages with mesg. Messages can
be printed on the screen as soon as they're received, or stored
to be read at your convenience. The system tells you when you get
mail. System-wide news can be read with news.
Reminder services
You can plan ahead with calendar; it reminds you of what you've
scheduled for today and tomorrow, based on what you've jotted
down in a special file. For finer distinctions of time, you can
use crontab. It's essentially a scheduler that can be told to
execute commands at any given minute, hour, date, day of the
week, month, and/or year. (Its use may be restricted, since its
main purpose is to perform system maintenance jobs, such as usage
accounting).
File security
The file system is like a room full of file cabinets. You may or
may not have the "keys" to any given cabinet. The file system
consists of files belonging to each user and to the system.
DG/UX protects users from each other (and its own files from
unauthorized users) with protection codes that are part of each
file. Each protection code consists of three values: one telling
what the owner may do, one telling what any member of a given
group may do, and one telling what anyone in the general public
may do.
You own a file if you created it or somebody used chown to make
you the owner. Groups are groups of users. Each group is like a
club; if you're listed as a member, you have the access
privileges of that club. You can be a member of many groups, but
only one is current at a time; use newgrp to change the current
group you have access to. All of the protection codes are coded
into each file's mode; you can use chmod and chgrp to change the
mode of any of the files you own.
You have a choice of shells to use; sh calls up the AT&T Bourne
shell; csh calls the Berkeley C-shell, which features a C-like
command language, command aliasing, and a history mechanism (it
DG/UX 4.00 Page 8
Licensed material--property of copyright holder(s)
INTRO(0)
can remember the last several commands that you issued).
SYSTEM MANAGEMENT
Administration
Administrators assign user privileges and environments, maintain
the system, monitor system accounting, and maintain system
security. Administrators can assign sh, csh, or a restricted
Bourne shell, rsh, as a user's login shell. They have complete
access to the system through the superuser login and su, with
which they can modify files, protections, profiles, and
passwords. They also set up the system identifiers (hostid,
hostname) and peripheral devices (stty, enable, disable). Note
that there are separate stty facilities for the Bourne shell and
the C shell. Interprocess communications are monitored with
ipcs; ipcrm removes identifiers that are associated with such
communications.
A running system is monitored with sar, which reports system
activity, and acctcom, which accesses process account files. A
running system must have its super block updated (sync) before it
is shut down.
Security
User security is maintained with login, which uses its knowledge
of names, passwords, and dialup passwords to control system
access, and passwd, which is used to change passwords. File
security can be maintained with chown, chgrp, and chown, which
the superuser can use to modify the protection of any file in the
system. For additional security, files can be encrypted with
crypt.
If free disk space gets low on the system, files can be compacted
with pack. They can then be read with pcat or unpacked with
unpack.
TEXT MANIPULATION
Writing or manipulating text means everything from borderline
file manipulation to full-screen editing in DG/UX. The most
sophisticated editor is vi, which is a full-screen version of ex,
Both feature explicit error messages, including warnings when you
seem about to do something damaging, plus an "undo" mechanism.
The original UNIX system editor, ed, is included; it is terser
about errors and complacent about doing anything you want, which
is dangerous for naive users. You can use it in shell scripts.
There is also a read-only stream editor, sed. Bfs will handle
DG/UX 4.00 Page 9
Licensed material--property of copyright holder(s)
INTRO(0)
very large files more efficiently than other editors. A
pattern-scanning and processing language, awk, is like a stream
editor, but it uses programming control structures; it is best
for jobs like scanning a file that you're using as an ad hoc
database (see File Manipulation, above).
You can generate a permuted index like the one in this book using
ptx.
DG/UX also has its own spelling checker (spell, spellin).
PERIPHERAL DEVICE MANAGEMENT
DG/UX can support a number of terminals; characteristics are set
up through stty. Files can be put on the printer queue with lp
or taken off with cancel; printers' status is checked with
lpstat. The amount of space used on a disk is checked with du.
Sending files to or from tape is accomplished with tar or cpio.
NETWORKING
DG/UX uses the TCP/IP networking protocols, and supports a
virtual terminal capability (telnet) and file transfer programs
(ftp, tftp). DG/UX also supports another set of intersystem
communications for UNIX systems (uucp, uulog, uuname, uustat,
uuto, uupick, uux) The intersystem facilities allow file transfer
and command execution among UNIX systems on a network; a job
control mechanism handles routes, schedules, and executing
intersystem requests.
OTHER TOOLS
Banner will print words in big letters. Cal will print a
calendar for any month or any year.
DG/UX 4.00 Page 10
Licensed material--property of copyright holder(s)
INTRO(0)
SYSTEM MAP
PROCESS CONTROL
id ...................... print user and group IDs and names kill
................................... terminate a process nice
......................... run a command at low priority ps
................................... report process status tty
........................... get the name of the terminal who
................................... who is on the system
FILE MANIPULATION
bdiff ............................................. big diff cat
............................ concatenate and print files cmp
...................................... compare two files col
.............................. filter reverse line-feeds comm
..... select or reject lines common to two sorted files cp
................................ copy, link or move files csplit
....................................... context split cut
......... cut out selected fields of each line of a file dd
................................. convert and copy a file delta
................ make a delta (change) to an SCCS file diff
.......................... differential file comparator diff3
................... 3-way differential file comparison diffmk
...................... mark differences between files dircmp
................................ directory comparison echo
........................................ echo arguments find
............................................ find files grep
........................... search a file for a pattern head
.................................. give first few lines join
.......................... relational database operator ls
.............................. list contents of directory more
................... file perusal filter for CRT viewing mkdir
..................................... make a directory nl
................................... line numbering filter pack
............................. compress and expand files paste
.......................................... merge lines pr
............................................. print files rm
............................. remove files or directories sdiff
...................... side-by-side difference program sort
............................... sort and/or merge files split
............................. split a file into pieces tail
....................... deliver the last part of a file tee
........................................... pipe fitting touch
....... update access and modification times of a file tr
.................................... translate characters uniq
....................... report repeated lines in a file wc
.............................................. word count
DG/UX 4.00 Page 11
Licensed material--property of copyright holder(s)
INTRO(0)
NUMBER TOOLS
bc ................. arbitrary-precision arithmetic language dc
......................................... desk calculator factor
..................................... factor a number units
................................... conversion program
SOFTWARE DEVELOPMENT
SCCS
admin ..................... create and administer SCCS files cdc
........... change the delta commentary of an SCCS delta comb
................................... combine SCCS deltas delta
................ make a delta (change) to an SCCS file get
.......................... get a version of an SCCS file getopt
............................... parse command options prs
..................................... print an SCCS file rmdel
..................... remove a delta from an SCCS file sact
.............. print current SCCS file editing activity sccsdiff
.............. compare two versions of an SCCS file unget
.................. undo a previous get of an SCCS file val
..................................... validate SCCS file what
................................... identify SCCS files
Languages & support
as ........................................ common assembler cb
.................................... C program beautifier cc
..................................... C language compiler cflow
................................ generate C flow graph cpp
............................ the C language preprocessor cxref
................... generate C program cross-reference dbx
............................................... debugger f77
.................................... FORTRAN 77 compiler ld
..................... link editor for common object files lex
............. generate programs for simple lexical tasks lint
................................... a C program checker make ...
maintain, update, and regenerate groups of programs od
.............................................. octal dump pc
................................ Pascal language compiler regcmp
.......................... regular expression compile sno
..................................... SNOBOL interpreter vc
......................................... version control yacc
......................... yet another compiler-compiler
Archive and library support
ar .... archive and library maintainer for portable archives cpio
......................... copy file archives in and out tsort
DG/UX 4.00 Page 12
Licensed material--property of copyright holder(s)
INTRO(0)
..................................... topological sort
DG/UX 4.00 Page 13
Licensed material--property of copyright holder(s)
INTRO(0)
Shell tools
basename .................... deliver portions of path names env
.................. set environment for command execution expr
................... evaluate arguments as an expression getopt
............................... parse command options line
......................................... read one line sh
................. shell, the command programming language shl
.................................... shell layer manager sleep
.................... suspend execution for an interval test
.......................... condition evaluation command time
........................................ time a command true
.................................. provide truth values xargs
....... construct argument list(s) and execute command wait
........................... await completion of process
USER ENVIRONMENT
cal ......................................... print calendar cd
................................ change working directory crontab
........................ crontab - user crontab file csh .......
a shell (command interpreter) with C-like syntax help
.......................................... ask for help logname
..................................... get login name machid
....... provide truth value about your processor type mail
....................... send mail to users or read mail man
........................... print entries in this manual mesg
............................... permit or deny messages newgrp
............................... log in to a new group news
...................................... print news items nice
......................... run a command at low priority pwd
................................. working directory name umask
.......................... set file-creation mode mask uname
.................... print name of current UNIX system write
................................ write to another user
SYSTEM MANAGEMENT
Administration
acctcom ........ search and print process accounting file(s) date
................................ print and set the date enable
.......................... enable/disable LP printers hostid
...... set or print identifier of current host system hostname
.......... set or print name of current host system ipcrm .......
remove message, semaphore, or shared memory id ipcs .. report
interprocess communications facilities status stty
........................ set the options for a terminal su
....................... become super-user or another user sum
DG/UX 4.00 Page 14
Licensed material--property of copyright holder(s)
INTRO(0)
............... print checksum and block count of a file sync
................................ update the super block
DG/UX 4.00 Page 15
Licensed material--property of copyright holder(s)
INTRO(0)
Security
chmod .......................................... change mode
chown ................................ change owner or group
crypt ........................................ encode/decode
login .............................................. sign on
passwd ............................... change login password sar
............................... system activity reporter
TEXT MANIPULATION
awk ............... pattern scanning and processing language bfs
....................................... big file scanner ed
............................................. text editor ex
............................................. text editor hyphen
............................... find hyphenated words ptx
......................................... permuted index sed
.......................................... stream editor spell
................................. find spelling errors vi .....
screen-oriented (visual) display editor based on ex
PERIPHERAL DEVICE MANAGEMENT
cpio ......................... copy file archives in and out du
.................................... summarize disk usage lp
.............. send/cancel requests to an LP line printer lpstat
......................... print LP status information tar
..................................... tape file archiver
NETWORKING
ftp .................................. file transfer program
netstat ................................ show network status
telnet ............... user interface to the TELNET protocol tftp
.................. DARPA trivial file transfer protocol uucp
....................... UNIX system to UNIX system copy uustat
................. uucp status inquiry and job control uuto
.................. public UNIX-to-UNIX system file copy uux
.................. UNIX-to-UNIX system command execution
OTHER TOOLS
banner ........................................ make posters cal
......................................... print calendar
DG/UX 4.00 Page 16
Licensed material--property of copyright holder(s)