In this tutorial we'll look at the first prerequisite skills listed in the Red Hat
exam prep guide. Linux administrators need an in depth knowledge of standard
command line tools. As described in the prerequisites they allow you to create,
remove, view, and investigate files in directories. We'll examine the commands
from the list of prerequisites one by one. The LS command lists files in the
current directory. But wait a second, Linux commands and file names are case
sensitive. Most commands are lower case. The LS command lists files in the
current directory with the right switches the LS command can be especially
useful in finding permissions. The LS-L lists permissions in the left hand column.
It lists file sizes in the middle, for example, the change log -2.6.19.1 is about
27 kilobytes large. It can help you list hidden files. Hidden files start with a
dot. It can help you find the newest files in a directory. If you specify LS-T
it lists the newest file first. You can reverse the order if you run LS-TR the
newest file is listed last. It can combine switches. I sometimes run the LS-LTAR
command which lists all files in the current directory including hidden files in
reverse chronological order. Next, the CP command copies files. One straight
forward way to use it is to back something up. For example, before I edit the
SMB dot com configuration file I usually back it up. A straight forward way to
do so is to copy from the original file name to a logical backup file name as
shown. Now I can edit the SMB dot com configuration file and if I screw it up I
can restore from a back up. With various switches I can copy directories
recursively. For example I often use the copy with archives recursive command,
CP-AR to copy all files in subdirectories. For example, if I wanted to copy the
RHCT directory for my home directory, the home directory is symbolized by the
tilda RHCT to the temp directory I'd run this command and now I can find a copy
of my RHCT directory in the temp directory along with the files they're in. Next
the move command copies files and then deletes the original. One way it can be
useful is to restore for a backup. Let's say I screwed things up with my Samba
configuration file. I run the move command MV and I'm restoring from my back up
file and now the backup file no longer exists. It's been used to overwrite the
original file. Next the remove command, RM, deletes files and directories with
the right switches can work recursively. For example the following command
deletes all files and subdirectories from the home student RHCT subdirectory.
But this command can be very dangerous if I make a mistake and put a space between
the first slash and the rest of the command I would delete all files in my top
level root directory and then everything would be gone and then the RM command
would try to find the files in the home slash student slash RHCT subdirectory
but by then my system would be a disaster. So use the RM-RF command with extreme
caution. Now let's look at a couple of commands that can look inside files. The
tail command can be especially useful for log files. For example if you're
monitoring new logs you can run the following command in one console, it watches
new messages, whoops, this requires root privileges, which I'll cover in another
tutorial. And I can watch as new log messages are added to this file. The cad
command is straight forward it lists the contents of a given file. Let's see how
that works on the standard user password database file, we'll look at more
commands in upcoming tutorials. But for now practice what you've learned. Check
out the main pages for each of these commands; see what else you can learn. The
tips and tricks you learn can save you time during the exam and in real life as
a Linux administrator. Thank you and on to the next tutorial.
Red Hat Certified Technician
Michael Jang
US$ 99.95
7 hours - 103 Movies
Win Vista XP 2000,ME. Mac OS X
Ground / 2 day / Next Day
33785
170 In Stock
Apex Web Media ( Hyperteach ) P.O Box 398 Bolton BL7 9YS, United Kingdom. Tel: +44 (0) 1204 592071 Fax: +44 (0) 1204 592092 Email:
Apex Web Media ( Hyperteach ) 600 17th Street, Suite 2800, Denver CO 80202 Tel: Toll free 1866 402 1903 (USA) / 434 878 4158 Fax: 1 207 433 4356 Email: