Podstrony
- Strona startowa
- Linux. .Mandrake.10.Podręcznik.Użytkownika.[eBook.PL] (3)
- Kirch O, Dawson T Linux. Podręcznik administratora sieci
- Linux Network Admistrator's Guide
- Linux Complete Command Reference
- Linux Podrecznik Administratora Sieci
- Bednarz Andrzej Medytacja teoria i praktyka (SC
- Marion Zimmer Bradley Dom swiatow
- Wharton William Dom na Sekwanie
- Gibson William Neuromancer (2)
- Tom Clancy Suma wszystkich strachow t.2
- zanotowane.pl
- doc.pisz.pl
- pdf.pisz.pl
- ugrzesia.htw.pl
[ Pobierz całość w formacie PDF ]
.7? [ynq] n/usr/man/man7/groff_char.7? [ynq] n/usr/man/man1/convert.1x? [ynq] n/usr/man/man1/xv.1? [ynq] n/usr/man/man1/xdvi.1? [ynq] n/usr/man/man1/dvips.1? [ynq] n/usr/man/man1/afm2tfm.1? [ynq] n/usr/man/man1/ps2pk.1? [ynq] n/usr/man/man1/ps2frag.1? [ynq] qReading Directories and FilesNow that you know about directory navigation, searching for files, and how to find moreinformation about programs, I ll introduce you to other basic Linux commands you canuse.This section shows you how to list the contents of directories, make a catalog ofyour hard drive, and read the contents of files.You ll learn the basic forms of thesecommands to help get you started.Listing Directories with the ls CommandThe ls (list directory) command is one of the most often used programs.In its simplestform, ls lists nearly all the files in the current directory.But this command, which hassuch a short name, probably has more command-line options (more than 75 at last count)than any other program!07 526-2 CH04 8/26/99 10:40 AM Page 79Reading and Navigation Commands 79Why are there so many Linux commands, and why do they have such shortnames? If you re not familiar with Linux, you ll soon find hundreds of pro-grams with short, initially cryptic names like cd, pwd, df, du, ps, ls, as, ar, at,w, and so on.Don t be intimidated! Instead, be thankful that Linux hasinherited this rich assortment of traditional UNIX tools.The UNIX philosophyis that a good program is small and does one thing very well; the power ofthe operating system comes from combining the output of several programsin concert.Many of the command names were chosen to save typing.Whyenter a long program name when one or two letters suffice? Also, manyearly UNIX users communicated with remote UNIX computers over very slow(110-baud) terminal lines, and short, precise commands were transmitted alot faster.To better appreciate the short command names, read Hour 6.In the simple form, ls lists the files in the current directory as in the following example:[home/bball]$ lsNews axhome nsmail searchauthor.msg documents reading vultures.msgauto mail research4The example lists files in my home directory.You can also list the files as a single line, with comma separations, using the -m option:# ls -mNews, author.msg, auto, axhome, documents, mail, nsmail, reading,research, search, vultures.msgIf you don t like this type of with the ls Commandlisting, you can have your files sortedhorizontally, instead of vertically (the default) with the -x option, as follows:# ls -xNews author.msg auto axhome documentsmail nsmail reading research searchvultures.msgAre all these just files, or are there several directories? One way to find out is to use the-F option:# ls -FNews/ axhome/ nsmail/ search*author.msg documents/ reading/ vultures.msgauto/ mail/ research/As you can see, the -F option causes the ls command to show the directories, each witha / character appended to the filename.The asterisk (*) shows that the file search is anexecutable program.But are these all the files in this directory? If you want to see every-thing, you can use the -a option with -F, as follows:07 526-2 CH04 8/26/99 10:40 AM Page 8080 Hour 4# ls -aF./.dt/.neditdb auto/./.dtprofile*.netscape/ axhome/.Xauthority.festival_history.newsrc documents/.Xdefaults.forward.oldnewsrc mail/.addressbook.fvwm2rc95*.pinerc nsmail/.addressbook.lu.index/.procmail/ reading/.bash_history.mailcap.procmailrc research/.bash_logout.mailrc.tin/ search*.bash_profile.mime.types.xinitrc* vultures.msg.bashrc.ncftp/ News/.desksetdefaults.nedit author.msgAs you can see, files or directories whose names begin with a period (.) are not dis-played by ls unless you explicitly request all files.Using the -F option is one way to seethe files and directories in your listings, but if you have a color monitor or use X11 incolor, you can tell ls to show files, directories, or executable files in different colors.Todo this, use the --color option like this:# ls --colorIn X11, using the xterm terminal, directories are blue, programs are green, and regularfiles are black.You can also customize which colors are used for different types of files.For example, to have all graphics files, such as PCX or GIF graphics, appear in red andall text files ending in.txt appear in purple, create a shell environment variable, orsystem- or user-defined value, named LS_COLORS, define the colors, and export the vari-able like this:# LS_COLORS= *pcx=31:*gif=31:*txt=35 ;export LS_COLORSThe ls man page lists the default colors.You can put your custom definitionin your.bashrc file for use the next time you log in to OpenLinux.As theroot operator, you can also specify systemwide default colors for all users.See Hour 6 to see how to define LS_COLORS and other environment variablesfor use by all users on your OpenLinux system
[ Pobierz całość w formacie PDF ]