Are you familiar with Telnet and Unix commands?
If you answered 'Yes' to a majority of these questions, then
you probably need it. Keep in mind, most site contruction and
modification can be done using FTP. The difference is in doing
things locally on your hard-drive, sending the HTML and graphics
to your Webspace, and replacing them with updates as needed.
With Telnet you have the ability to do changes in 'real-time'.
In fact, there is very little site construction you cannot do
with FTP so remember, you can always user your telnet account
at a later time if you don't need it right now.
Basic UNIX Commands
O.K. You've telnetted in and would like to know a few commands?
Well, you would be better off buying the book "Teach Yourself
UNIX in a Week" published by SAMS, or UNIX for Dummies.
But since you insist, described are some basic UNIX commands.
You will find them quite similar to IBM DOS.
If your account is a domain account you will land in your /usr/home/your-id
directory. This is not the same as your /www/htdocs/yourdomain
directory where your WWW documents will be kept and where you
land when you FTP into the system. The /usr/home/you is where
your administrative files such as your mail redirect file are
kept. Change directory to /www/htdocs/yourdomain to work on your
web documents.
cd /www/htdocs/yourdomain
mv
mv fred wilma
This moves fred to a file named wilma. Similar to renaming it.
mv fred flintstones/fred
This moves fred to a file named fred in the subdirectory flintstones.
mkdir
mkdir flintstones
This makes a subdirectory named flintstones.
cp
cp fred wilma
This copies fred to a file named wilma.
cp fred flintstones/fred
This copies fred to a file named fred in the subdirectory flintstones.
rm
rm flintstones
This removes a file named flintstones.
rm -rf flintstones
This removes a directory named flintstones. The -r removes the
directory, the -f forces it to remove files without asking you
before it deletes each one.
cd
"cd flintstones"
This changes the directory to the subdirectory named flintstones.
"cd /home/flintstones"
This changes the directory to the home directory of the flintstones.
"cd ~flintstones"
Also changes the directory to the home directoy of the flintstones.
"cd /www/htdocs/flintstones"
This changes the directory to the web directory of the flintstones.
"cd -"
This is a short cut to put you in the last directory you were
in.
ls
"ls g*.*" will bring up all files that begin with g
and have a "." in them.
Type "ls g*" to bring up all files that begin with
a g.
You may type "dir" instead of "ls".
Managing the Linux Account
ln (redirecting file access)
Type ln -s fred.html index.html to redirect all file accesses
from index.html to the file fred.html.
zip/unzip
Type zip to zip files and unzip to unzip files. This program
is compatible with the zip program for DOS. For example:
$ zip myzip file1 file2 file3
This puts the files file1, file2, and file3 into a new zip
archive called myzip.zip. On the other hand, if you had the archive
myzip.zip and wanted to get back the files:
$ unzip myzip
Typing zip or unzip by itself will give you
a usage summary, showing nearly all the options availible.
du (disk usage)
The Unix command
du -s directory
shows how much disk space is used by a directory and everything
below it. While we work on creating the complicated command needed
to automatically check all the directories you are associated
with, you can find out how much space is in use by the WWW files
for a domain with
du -s /www/htdocs/domain If you don't have anything
much in your home directory or mail spool, this comes close to
the total space you have in use. (You would know if you did have
other things in your home directory, and could use du -s $HOME
to check on that.)
If you have an anonymous FTP area, also check
du -s ~ftp/my.domain
For example, freddy.com might need to run some number of the
following:
du -s /www/htdocs/snoopy
du -s ~ftp/snoopy.com
du -s $HOME
and add the results to find out how much space he's using.
Locate (find files)
The normal Unix methods of locating files have one thing in
common, they are slower than molasses on a winter night in Alaska.
So instead, we use a powerful program called locate. Type locate
file_name and the server will immediately locate all files that
contain the file_name. (Provided such files have been on the
machine at least one day.)
Controlling finger
(For anything in this section to have effect, your home directory
must be world executable. chmod o+x ~ to effect this.
If you can't telnet in but can FTP in, the commands would be
cd /home followed by chmod 0711 your-login.)
If you wish to make information availible via the finger
service to the world, put it in one or more of the following
files, any of which would go in your home directory: .plan, .project,
.pgpkey, .xface. If you don't know which one to use, use .plan.
If you do not wish the usual information (last login,
last mail reading, etc.) availible, create a .nofinger file.
The contents of this file will be displayed in lieu of anything
else.
Doing a little work online
pico (editing files)
When you need to edit a file on-line, after using rlogin or
telnet to log in to our machine, type pico filename to
edit the file called filename. Pico is the easiest editor
available to learn. Text that you type is inserted at the cursor.
Your terminal's arrow keys should move the cursor through the
file.
Some commands that you will need are printed at the bottom
of the screen. The keys to press are presented as '^X'. This
long-standing shorthand in the computer world means the same
as Control-X, in other words, hold down the Control or Ctrl key
on your keyboard and type an 'x'.
Of course, other editors are available on the system, so if
you already know vi, emacs, or joe, or if you have someone to
teach you the basics of these programs with you, feel free to
use them. Even ed is still there for those of you updating World
Wide Web pages with a teletype.
Another Introduction and some help to Telnet is located:
galaxy.einet.net/hytelnet/TELNET.html
Some Telnet programs you can download are located:
NoNags Webware Site (this
site has EVERYTHING!)