Tis a Gift to Be Simple But Never Think of Unix as a Gift
Unix came along when the size of machine memory was small and precious. As a result, Unix commands tend to have very short, mysterious names. An example of this is the command to list the contents of a directory. It is not 'directory' and it is not 'list', it is
Your unix home directory can have subdirectories under it, which in turn can have subdirectories, and so on. A full file name will have its directory path appended to the beginning. Users of DOS will have become familiar with this, with one special difference. DOS uses a '\' (backward slash). In Unix the directory names are separated by a '/' (forward slash). From any directory you can easily create a subdirectory with
mkdir subdir (you should pick a meaningful name in place of 'subdir')
The ls command will show both subdirectories and regular files. If you need to see more clearly which is which, try
ls -F
In this listing, directory names will have a '/' appended to the end. You can change into a subdirectory with the change directory command.
cd subdir
You can continue to change down into subdirectories with the cd command, and even jump down several at once with
cd subdir/subdir/subdir
but just like paths in life, you cannot easily just jump from one to the other especially if they are not closely placed in the directory structure. There are several ways to jump around your directory when you want to move upwards or 'sideways' in the directory. A simple way to move back up one directory is
cd .. (that's two periods one after the other)
or you can go back two subdirectories with this:
cd ../..
How about going down a subdirectory that is located in the next directory back (assuming you've created one)? Try this
cd ../subdir
Of course, by now you are hopelessly lost in your directory structure. Try this to find out where you are (it stands for 'print working directory')
The next task you might think to do would be to create a file. This is done with an editor. There is an editor in Unix called ' vi ' but there are much easier editors to learn to use such as pico and emacs . They aren't standard to Unix but most installations add them in. Try this
pico filename
Now you can try the next command which will rename a file. The Unix command actually looks like the word 'move.'
mv oldfilename newfilename
With the mv command you can also move a file into a subdirectory with
mv filename subdir
The name of the subdirectory you give must have all of the interceding subdirectories listed, separated by '/', of course, if it is not directly connected to the directory where 'filename' resides. And the last basic command you might want to use with a file is the delete command, which comes from the word 'remove.' So to delete a file, type
rm filename
© 1998, The University of Alabama. The information included here is for the University of Alabama central computing facility as it was configured on the document date. It may or may not apply to other Unix systems.

