|
Now
that you can connect to your Virtual Server, you need
to understand what you are seeing. Since the Virtual Server
is essentially your own UNIX machine, an understanding
of the UNIX file system and UNIX commands is extremely
helpful. This section is a crash course on the unix file
system as well as the Virtual Server directory and file
structure.
The UNIX File System The following is a sample
of a UNIX path:
/usr/home/login_name
In the above path the
first forward slash (/) is the top level directory
called the "root" directory. The usr
directory is a subdirectory of the root directory, home
is a subdirectory of usr, and login_name
is a subdirectory of home. If your login name
were "bob", then bob would appear in
the place of login_name. Each "/"
after the root directory is just a separator.
To change to a directory
you use the cd (change directory) command. You
can cd to a directory by typing the absolute path,
meaning that the entire path starting from root is typed
out like the above sample, or you can specify a relative
path:
% cd tmp
The above command uses a
relative path to change to a subdirectory of the current
directory.
The cd command is
easy to master after a little practice. The chart below
shows what happens when you type cd alone or with various
arguments. Try of few of these cd examples and then type pwd (Print Working Directory) to see which directory
you are currently in.
Basic UNIX Navigation
Commands
The following basic UNIX
commands can help you navigate the UNIX file system.
|
Command |
Example |
Function |
|
ls |
ls
ls -l
ls -al
ls /usr/home |
list files in the
current directory
list files in the
current directory in a long listing
list all files
including files beginning with a "."
list files in the
/usr/home directory |
|
pwd |
pwd |
print working directory
- check the current directory |
|
cd |
cd |
changes to your
assigned home directory |
|
cd /usr/home |
change directory
to /usr/home |
|
cd bob |
change directory
to bob |
|
cd .. |
change up one directory
(.. represents parent dir) |
|
cd ../logs |
change up one directory
and down to the logs directory |
|
mkdir |
mkdir tmp |
make directory
tmp under the present directory |
|
rmdir |
rmdir tmp |
remove directory
tmp |
|
rm |
rm test |
remove the file
test |
|
rm -f test |
remove the file
test without prompting |
|
rm -rf tmp |
remove the tmp
directory and all subdirectories and files in
tmp without prompting (be very careful with this) |
|
cp |
cp test test.new |
copy the file test
to test.new |
The following is a list
of file system symbols and definitions:
|
Symbol |
Definition |
|
. |
Current directory |
|
.. |
Parent directory |
|
/ |
When used by itself
or at the beginning of a path it represents the
root directory. When used within a path it is
a separator. |
|
~ |
Alias for the path
to users home directory /usr/home/login_name. |
Note: If you are
logged in as Bob and your home directory is /usr/home/bob,
then cd ~/etc would change to /usr/home/bob/etc.
Directories and FilesEach new Virtual Server
contains the following directories and files by default.
The tilde ("~") represents the path /usr/home/login_name
(the full path to the Virtual Server's home directory).
You see the path /usr/home/login_name only
while you are connected to your Virtual Server via Telnet
or SSH. If you are connected to your Virtual Server via
FTP or HTTPD, the root directory is changed to /usr/home/login_name
and becomes "/".
% ls -l
total 7
drwxr-xr-x 2 bob vuser 512 Apr 11 17:48 bin
drwxr-xr-x 2 bob vuser 512 Feb 5 19:52 dev
drwxr-xr-x 3 bob vuser 512 Jun 28 15:38 etc
drwxr-xr-x 3 bob vuser 512 Jan 7 13:53 ftp
drwx--x--x 3 bob vuser 512 Jun 19 16:35 tmp
drwxr-xr-x 9 bob vuser 512 Jan 17 12:42 usr
drwx--x--x 10 bob vuser 512 Jun 19 16:35 var
lrwxr-xr-x 1 root vuser 19 Apr 1 10:31 www
-> usr/local/etc/httpd
Description of Directories
|
Directory |
Description |
|
~/bin |
Contains servers
program files such as ftp and sendmail |
|
~/dev |
Contains the device
node null |
|
~/etc |
Contains servers
configuration files such as passwd, resolv.conf,
aliases, and sendmail.cf |
|
~/ftp |
Anonymous ftp directory |
|
~/tmp |
Temporary files |
|
~/usr |
This directory
contains the following subdirectories: |
|
~/usr/home |
Users home directories |
|
~/usr/mail |
Users mail messages
are stored here. Each user has a mail file named
by their E-mail login name |
|
~/usr/log |
Contains the messages
file (a transaction log of E-mail, ftp, and Telnet
sessions) |
|
~/usr/spool/mqueue |
Contains mail messages
waiting for delivery |
|
~/usr/bin |
Contains additional
server programs |
|
~/usr/local |
Contains directories
like httpd or frontpage |
|
~/usr/local/etc/httpd |
The virtual httpd
server's root directory which contains the following
subdirectories: |
|
~/usr/local/etc/httpd/htdocs |
Contains the html
files (this is where you place your web pages) |
|
~/usr/local/etc/httpd/cgi-bin |
CGI and scripts
directory |
|
~/usr/local/etc/httpd/conf |
httpd servers configuration
files |
|
~/usr/local/etc/httpd/logs |
httpd servers log
files |
|
~/var |
Dynamic data files
such as mail files and log files< |
|
~/www |
Link to ~/usr/local/etc/httpd
for convenience in changing directories |
Directories Outside
of the Virtual ServerIn addition to the directories
in the Virtual Server, you should familiarize yourself
with a few directories outside of the Virtual Server (which
you can access while connecting via Telnet or SSH).
|
Directory |
Description |
|
/usr/local/contrib |
Contains installation
files for useful programs like Perl, iManager,
CGIs, etc. This directory is frequently updated
with instructions for installing the applications
posted on the web site. |
|
/backup/home/login_name |
This is a full
uncompressed copy of your Virtual Server. The
Virtual Server is copied nightly. If you delete
a file, you may copy a backup from /backup/home/login_name. |
File Ownership and PermissionsDefining Output
This section defines, in
more detail, the sample output from the ls -l command
shown again below.
%
ls -l
total
7
drwxr-xr-x 2 bob vuser 512 Apr 11 17:48 bin
drwxr-xr-x 2 bob vuser 512 Feb 5 19:52 dev
drwxr-xr-x 3 bob vuser 512 Jun 28 15:38 etc
drwxr-xr-x 3 bob vuser 512 Jan 7 13:53 ftp
drwx--x--x 3 bob vuser 512 Jun 19 16:35 tmp
drwxr-xr-x 9 bob vuser 512 Jan 17 12:42 usr
drwx--x--x 10 bob vuser 512 Jun 19 16:35 var
lrwxr-xr-x 1 root vuser 19 Apr 1 10:31 www
-> usr/local/etc/httpd
Starting with the column
on the left, the following definitions apply.
|
Column |
Definition |
|
drwx and -rw |
Defines the file
mode. The file mode is the type of file and permissions
on the file. |
|
Number of links |
A file or directory
can be a link to other files. |
|
Owner name |
Login name of the
file's or directory's owner. |
|
Group name |
Group ID to which
the file belongs. |
|
Size |
In bytes. |
|
Date and time |
Time stamp of last
modification. |
|
Pathname |
Name of file. |
File ModeThe file mode is a 10-character
label that identifies the type of file and the permissions
for the owner or group. The first character identifies
the type of file. The following characters are often found
as the first characters.
|
Character |
Description |
|
- |
normal file |
|
d |
directory |
|
l |
link to another
file or directory (link is shown in the last column) |
The next nine characters
of the file mode block are separated in three groups
of three characters: permissions for the owner, group,
and other. The following table summarizes these three
blocks of the file mode.
|
Character |
Permission |
Value |
|
- |
none assigned |
|
|
r |
read |
4 |
|
w |
write |
2 |
|
x |
execute |
1 |
A file called test
with a file mode of -rwxr-x--- has a value of
750. The numeric value is used when you change
the mode with the chmod (change mode) command.
For example:
% chmod 755 test
The number changes the test
file mode to read, write, execute for the owner; read
and execute for the group and other. The file mode is
now:
-rwxr-xr-x
For more information,
type man chmod from the UNIX command-line prompt
on your Virtual Server.
|