Topics Map > University of Chicago > IT Services > Applications, Operating Systems, & Devices
Basic Unix - Looking Around
This article describes how to look around in the Unix operating system.
Unix is structured like a tree. The "root" of the tree is indicated by a forward slash, / . The root contains a number of branches, called directories. Directories can contain both files and subdirectories. Your home directory is located on one of these branches.
Where am I? (pwd)
To find out which directory you are in at any given time, type:
If you are in your home directory (as when you first log in), you may see something like this:
Note the machine your account is located on (in the example above, the account "myname" is located on "harper"). For best results, always log into the machine where your home directory is assigned.
Listing files (ls)
To show what files are contained in a specified directory, use the "ls" (list files) command. Options for the "ls" command include: "l," to show more detailed information about each file; "a," to show all files (files that have names starting with a period will not normally show up in an "ls" listing); and "F," to mark directories and executable files.
To show a long listing of all files in the current directory with subdirectories and executable files marked, type:
ls -laF <ENTER>
Moving around (cd)
To connect to other directories, use the "cd" (change directory) command. To move to a directory called /usr/local/doc (a public directory elsewhere on the system), type:
cd /usr/local/doc <ENTER>
To list the files in this directory, type:
Some of the files in this directory are actually subdirectories that you can "cd" into and some are files which you can read or copy to your own directory. The default assumption on the Server Cluster is that unless permissions are set otherwise, you can connect to any directory and read any file, except for private mailboxes. And in fact, you can learn a great deal about Unix just by connecting to various directories and listing their contents. Out of respect for others' privacy, however, you should limit yourself to system directories and files unless you are certain that the person whose directories you are looking at actually intended for others to see his or her files.
To return to your home directory from any other location, type:
Reading files (cat and more)
The "cat" and "more" commands display files on the screen. The simplest of these, "cat," lists the entire file without stopping. The "more" command displays a file screen by screen. To read a file in the directory /usr/local/doc called getting-help, type:
more /usr/local/doc/getting-help <ENTER>