Advanced Programming in the UNIX® Environment

(lily) #1
ptg10805159

6 UNIX System Overview Chapter 1


Some UNIX systems further divide the manual pages within a given section, using an
uppercase letter.For example, all the standardinput/output(I/O)functions in AT&T [1990e]
areindicated as being in Section 3S, as infopen(3S).Other systems have replaced the
numeric sections with alphabetic ones, such as C for commands.

Today,most manuals aredistributed in electronic form. If your manuals areonline,
the way to see the manual pages for thelscommand would be something like
man 1 ls
or
man -s1 ls
Figure1.3 is a program that just prints the name of every file in a directory,and
nothing else. If the source file is namedmyls.c, we compile it into the defaulta.out
executable file by running
cc myls.c

Historically,cc( 1 )is the C compiler.Onsystems with the GNU C compilation system, the C
compiler isgcc( 1 ).Here,ccis usually linked togcc.

Some sample output is
$./a.out /dev
.
..
cdrom
stderr
stdout
stdin
fd
sda4
sda3
sda2
sda1
sda
tty2
tty1
console
tty
zero
null
many morelines that aren’tshown
mem
$./a.out /etc/ssl/private
can’t open /etc/ssl/private: Permission denied
$./a.out /dev/tty
can’t open /dev/tty: Not a directory
Throughout this text, we’ll show commands that we run and the resulting output in this
fashion: Characters that we type areshown in this font,whereas output from
programs is shownlike this.If we need to add comments to this output, we’ll show

http://www.allitebooks.com^

http://www.allitebooks.com^ - Advanced Programming in the UNIX® Environment - free download pdf - issuhub">
Free download pdf