Unix File Structure
The UNIX operating system supports a tree-like hierarchial file structure that is managed by directories. The highest level is known as the "root" and below the root is other directories and files. Your home directory (login directory) is specified by '~' and '.' is the directory that you are currently in. The command 'pwd' will give your current working directory. Also, the parent directory can be given by '..' for all directories except root.
A pathname specifies the name of a directory/file and can be expressed as a complete or relative path. Complete names begin with a '/' and follow directories from the root. The directory/file names are also separated by slashes. Relative file names do not begin with a '/' and can only go down the tree. The 'cd pathname' changes directories.
Example:
If sally logs in, her home directory is point a
0) passwd - changes your password (probably want to do this right away)
1) cd .. - changes to point b
2) ls ~ - will list first.pas (all files in your home directory)
ls -al will give a more detailed listing of the current directory
3) ls /usr/games - lists zork and aliens (the files in the directory games)
4) pwd - lists /users/CS440/sally (the present working directory)
5) cp p1.c bp1.c - will make a backup copy of p1.c and name it bp1.c
6) mv p1.c bp1.c - will rename the file p1.c to bp1.c.
7) rm p1.c will remove the file p1.c in the current directory.
8) mkdir backup - will make a directory below sally called backup
9) rmdir backup - will remove a directory if empty called backup
10) cat filename - lists an entire text file to the screen
11) more filename - lists an entire screen's worth of the text file and prompts the user for more
a) space - gives the next screen of information
b) return - gives one more line
c) q - quits more
12) pico filename - runs the pico editor which allows you to edit a file on redrocks.
13) lpr -P venus filename - will print a file to the HP Laser in the computer lab.
14) It is my understanding that the following printers are also available to print to:
lpr -P strain1 filename
Note: Some of these printers will certainly change as the campus changes, so be flexible!!
Please do not print anything unless you are going to pick up the printout right away.
15) gcc filename.c - will compile the C program filename.c