UC Irvine,
Information and Computer Science Department
Winter 2000
ICS 54:
Brief Notes on Chapter 6: File and Directory Basics
The UNIX file system is hierarchical
% pwd
/home/ics54/www
./doc
./doc/Ch01
./doc/Ch02
......
./doc/Ch18
./doc/Ch18/Part1
./doc/Ch18/Part1/images
./doc/Ch18/Part2
......
./doc/apache
./doc/apache/Live
./doc/apache/Live/conf
./doc/apache/Live/conf/OLD
./doc/apache/Live/temp
./images
./images/OLD
./originals
./private
./private/doc
The UNIX file system's contents
- A directory is a (special) file containing
names and addresses of other files
- A regular (ordinary) file contains data which might,
in fact, be an executable program
- A symbolic link is a file which points to another
file
- A hard link a directory entry giving a file an
alternate name.
- Other collections, sources, or targets of data flow are
also treated as special files:
- Character and Block Device Files
- UNIX Domain Sockets (BSD)
- Named Pipes (ATT)
System directories
- /bin /user/bin: executables for many Unix commands
- /etc: system data files
- /dev: special files representing I/O devices
- /dev/ttyp0: pseudo terminals
- /dev/kmem: memory
- /dev/printer: printer
- /dev/null: the null device
- /usr/man: contains manual pages
- /tmp: for temporary files
Accessing files and directories
- Each user ($USER) has a home directory ($HOME)
- Specify a file in one of three ways
- a simple file name
- absolute/full path name
- relative path name =
path name relative to the current working directory
- $cwd = Current Working Directory
- cd = Change Directory
- . = the current working directory
- .. = the parent of the current working directory
- Files whose names begin with "," or "#" are
"scratch files" and deleted periodically
Comments are welcome.
Current as of 11 January 2000
HTML
4.01 Checked.