Unix
FAQ
- How
do I change my Password?
- Is index.html a different
file from INDEX.HTML?
- How do I get online
help for a UNIX command?
- How
do I edit my files while they are on the server?
- How do I list my files
& directories?
- How do I change directories?
- How do I make directories?
- How do I remove directories?
- How do I copy files &
directories?
- How do I move (rename)
files?
- How do I remove files?
- How do I search within
files?
- How do I change file
and directory permissions?
- How do I back up files
& directories?
- How do I compress &
uncompress files & directories?
Is index.html a different
file from INDEX.HTML?
Yes, unlike Windows or DOS, UNIX is case sensitive.
This means that index.html is different from Index.html, INDEX.HTML
and all its various case combinations.
This creates a problem when transferring your site from your
hard drive (Windows or DOS) to one of our UNIX servers. It
can often result in pages having broken links and missing
images.
If you encounter this problem, check to make sure that your
hyperlinks in your web pages correspond to the exact filenames
on your website. If they do not match, you can either modify
your hyperlinks in your web pages or rename your files with
an FTP program so they match your hyperlinks.
Also note that your user name, password and all UNIX commands
are case sensitive.
How do get online help
for a UNIX command?
The man command,
short for manual, displays online help for a particular UNIX
command.
- Type
man ls
at the command prompt to get information on the Ls
command.
How do I list my files
& directories?
The Ls command
lists the files and subdirectories of the current directory.
This is equivalent to the dir
command in DOS.
Ls -a
will show all hidden files such as .htaccess
Ls -l
will show detailed information including permissions,
owners, size and file modification time.
TOP
How do I change directories?
The cd command
will change to another directory. This is equivalent to the
CD, chdir
in DOS.
- Once you login to your account with telnet, type
CD
HTML to change to your HTML directory.
- Type
CD
to return to your home directory ( /home/your_user_name
)
- Type
CD ..
to change to the directory just above the current one.
How do I make directories?
The mkdir
command makes a new directory. This is equivalent to the md,
mkdir commands
in DOS.
- At a telnet prompt, type
mkdir
test to create a new directory called
test.
How do I remove directories?
The rmdir
command will remove an empty directory. This is equivalent
to the rd,
rmdir commands
in DOS.
- At a telnet prompt, type
rmdir
test to remove a directory called test.
TOP
How do I copy files &
directories?
The cp command
copies a file to a new directory or filename. This is equivalent
to the copy
command in DOS.
- Typing
cp welcome.htm index.html
at the telnet prompt will copy the welcome.htm file to the
index.html file.
- Typing
cp welcome.htm HTML/index.html
at the telnet prompt will copy welcome.htm to the index.html
located in the HTML directory.
- Typing
cp * /home/your_user_name/HTML
at the telnet prompt will copy all the files in the current
directory to your HTML directory
How do I move (rename)
files?
The mv command
moves a file to a new location or renames it. This is equivalent
to the move,
ren, rename
commands in DOS.
- Typing
MV * /home/your_user_name/HTML
at the telnet prompt will move all the files in the current
directory to your HTML directory
- Typing
MV welcome.htm index.html
at the telnet prompt will rename the welcome.htm file to
the index.html file.
- Typing
MV welcome.htm HTML/index.html
at the telnet prompt will rename welcome.htm to index.html
located in the HTML directory.
TOP
How do I remove files?
The rm command
removes (deletes) a file.
Please be careful removing files; there is no un-remove
command!
This is equivalent to the del
command in DOS.
- Typing
rm test.htm
at the telnet prompt will remove the test.htm file.
How do I search within
files?
The grep
command finds lines in files that match specified text patterns.
The syntax is as follows grep
text filename
- Typing
grep welcome index.html
at the telnet prompt will find any lines in the index.html
containing the text welcome in them.
- Typing
grep hello *
at the telnet prompt will find any files in the current
directory that contain the text hello in them.
How do I change file
and directory permissions?
The chmod
command sets the permissions of a file or directory. There
are 3 sets of permissions for files and directories: owner,
group and other which are controlled by read, write and execute
permissions. This is equivalent to the attrib
command in DOS.
- Type
chmod 755 *.cgi
to make your cgi scripts executable.
- Type
chmod 755 cgi
to set the permissions on your CGI directory.
TOP
How do I back up &
restore files & directories?
The tar command
is an archiving utility for packing many files into a single
archive file while retaining file permissions and ownership.
- Type
tar cvf backup1.tar
HTML in your home directory to archive
the contents of your HTML directory into backup1.tar
- Type
tar xvf backup1.tar
in your home directory to restore (replace) the contents
of your HTML directory from backup1.tar
How do I compress &
uncompress files & directories?
The tar command
can be used with gzip to compress many files into a single
archive while retaining file permissions and ownership. Please
note that these files can be decompressed with WinZIP.
- Type
tar czvf backup2.tgz
HTML in your home directory to compress
the contents of your HTML directory into backup2.tgz
- Type
tar xzvf backup2.tgz
in your home directory to restore (replace) the contents
of your HTML directory from backup2.tgz
TOP
|