In
Unix, everything is composed of files and folders. A folder in Unix
is called a directory. When you log in to your hosting account, you
will be in your home directory. Your home directory should be /users/u/username,
where the first directory is /users, the directory under /users is the
first letter of your username, and the directory under that is
your username.
There
are some things to note about the Unix filesystem:
Your home directory is denoted as ~ in Unix. Changing directories to
~ will put you in your home directory. You can also use ~ to make relative
paths, if you wanted to change directories to a subdirectory in your
home directory called "stuff", you could change directories
to ~/stuff/
The
. and .. (period and double-period) have special meanings in Unix.
The .. means "up one directory". If you're in ~/www/old-website/myfiles/images,
and you want to go up to ~/www/old-website/myfiles, you can change directories
to .. and you will go "up" one directory.
The . means "this directory", or, more accurately "current
directory". This is useful when you are trying to run a program
or script out of the current directory. If you try to run a program
from a location that's not in your "path" (more in a minute
on paths), the computer won't recognize what you're trying to run. So
you could run the program via absolute path (/users/u/username/scripts/scriptname),
or you could change directories to the directory in which the script
resides and run it via the "dot-slash" method, ./scriptname.
Your
path is a list of directories which the computer searches to find a
command matching the one you indend to run. When you run the cd command
to change directories, it searches through it's pathlist until it finds
the command, in this case in /bin. Running /bin/cd
~/www/ will have an identical effect to running cd
~/www/ - they will both take you to your home directory, sub
directory www. You can edit your path in a file in your home directory
called .cshrc.
You can view the list of directories in your path by typing echo
$PATH.
Files
that begin with a period, such as your .cshrc file, are treated differently
by Unix than other files - they are the equivalent of "hidden files"
in windows. When a file has a leading period, a simple directory listing
will not show the file. Usually these are files that you don't need
to edit, or even see, they store background information.