|
Command |
Example |
Definition |
|
cd |
cd |
Change to your
home directory |
|
cd ~/www |
Change to the /usr/home/login_name/www |
|
cd .. |
Move up a directory |
|
chmod |
chmod 755 test |
Change the permissions
of the file test to be rwxr-xr-x |
|
cp |
cp test test.new |
Copy the file test
to test.new |
|
grep |
grep test *.html |
Search for the
word test in the html files |
|
kill |
kill 2267 |
Kills a process
(the ps or top command will show
you the process id) |
|
ls |
ls -al |
List files |
|
ll |
Alias setup to
do a ls -al |
|
mkdir |
mkdir test |
Make a directory
called test |
|
more |
ll | more |
Used to display
the directory listing one screen at a time |
|
more README |
Display the README
file one screen at a time |
|
mv |
mv test test.new |
Move the file test
to test.new |
|
ps |
ps -ax | grep aftpd |
Lists all of the
aftpd processes |
|
ps -ax | more |
Lists all of the
Virtual Server's processes |
|
quota |
quota |
Shows the Virtual Server's quota usage |
|
rm |
rm test.new |
Remove the file
test.new |
|
rm -rf billdir |
Remove the directory
billdir. Use this command with caution
as there is no "undo" command in UNIX. |
|
sinfo |
sinfo |
Shows the Virtual Server's hostname, ip, login, and host server. |
|
uptime |
uptime |
Shows how long
the server has been up and current load information. |
|
tail |
tail -f message |
Watch information
being added to a file. Watch the logs as they
are being added to. Executed from the directory
where message exists (~/usr/log/ or ~/var/log/). |
|
tar |
tar -cvf abc.tar
abcdir |
Create a tar
(tape archive) file called abc.tar and
include the abcdir directory |
|
tar -xvf abc.tar |
Extract all of
the abc.tar files into your current directory |
|
top |
top |
Show the top
processes and load average on your Virtual Server |
|
traceroute |
/usr/sbin/traceroute
domainname |
Trace the route
to a domain or IP number. Useful for troubleshooting
slow connections. |
|
vdiskuse |
vdiskuse | more |
Shows the disk
usage by directory |
|
vadduser |
vadduser |
Add a virtual user
to e-mail and ftp |
|
vrmuser |
vrmuser |
Removes the virtual
user |
|
vlistuser |
vlistuser |
List the users
on your server |
|
vnukelog |
vnukelog |
Interactive mode |
|
vnukelog -r |
Remove the log
files - ~/usr/log/messages, ~/www/logs/*_log |
|
vnukelog -h |
Help screen for
vnukelog |
|
vpasswd |
vpasswd username |
change or set passwords |
|
virtual |
virtual sendmail
-bp |
Used for running
programs in the virtual environment. |
|
virtual ./test.cgi |
Test the test.cgi
from the command line |
Editing Files OnlineDownloading files, editing,
then uploading the files is not the fastest way to make
simple changes. The experienced Virtual Server administrator
uses an online editor to make changes to files while in
a Telnet or SSH session. Below are a couple of the online
editors available.
Using vi to EditThe vi program is
a common UNIX editor. The commands in vi are a
bit difficult to get used to at first. When you get used
to the commands, it is a powerful tool. Here are some
of the basic commands. If you get stuck, try hitting the ESC key until you can type :q! to quit.
|
Command |
Effect |
|
vi filename |
open a file in
the vi editor |
|
j |
Move down a line |
|
k |
Move up a line |
|
l |
Move right |
|
h |
Move left |
|
i |
Insert text at
the cursor changes to the edit mode use
ESC to exit the edit mode |
|
a |
Add text after
the cursor |
|
o |
Open a blank line
below the cursor |
|
ESC |
Exit the edit mode |
|
SHFT g |
Move to the bottom
of the file |
|
<ctrl>-g |
Report what line
the cursor is line |
|
:1,10d |
Delete lines 1-10 |
|
x |
Delete the character
the cursor is on |
|
dd |
Delete the line
the cursor is on |
|
/test |
Search for test |
|
:1 |
move to line one |
|
:q |
Quit vi |
|
:q! |
Quit vi
without saving changes |
|
:wq |
Save file and quit
vi |
|
:%s/test/foo/g |
Search for test
and replace it with foo throughout the
file. |
The Pico commands
are listed at the bottom of the screen. You can move
the cursor to enter and delete text in the file you
are editing.
Note: The -w
option prevents line wrap, which can cause some configuration
files not to function properly. So you should use the
-w option to be safe.
For additional information
about the topics discussed in this chapter, see the following
pages on the Enetrics Communications web site.