Novell SUSE LINUX Professional 9.3 Update 00662644461625 用户手册

产品代码
00662644461625
下载
页码 304
The archive files created by
tar
end with
.tar
. If the tar archive was also
compressed using
gzip
, the ending is
.tgz
or
.tar.gz
. If it was com-
pressed using
bzip2
, the ending is
.tar.bz2
. Application examples can
be found in Section 19.1.8 on page 253.
locate pattern(s)
This command is only available if you have installed the
findutils-locate
package. The
locate
command can find in which
directory a specified file is located. If desired, use wild cards to specify file-
names. The program is very speedy, because it uses a database specifically
created for the purpose (rather than searching through the entire file sys-
tem). This very fact, however, also results in a major drawback: locate is
unable to find any files created after the latest update of its database. The
database can be generated by
root
with
updatedb
.
updatedb [options(s)]
This command performs an update of the database
used by
locate
. To include files in all existing directories, run the program
as
root
. It also makes sense to place it in the background by appending
an ampersand (
&
), so you can immediately continue working on the same
command line (
updatedb &
). This command usually runs as a daily cron
job (see
cron.daily
).
find [option(s)]
With
find
, search for a file in a given directory. The first
argument specifies the directory in which to start the search. The option
-name
must be followed by a search string, which may also include wild
cards. Unlike
locate
, which uses a database,
find
scans the actual direc-
tory.
Commands to Access File Contents
cat [option(s)] file(s)
The
cat
command displays the contents of a file,
printing the entire contents to the screen without interruption.
-n
Numbers the output on the left margin
less [option(s)] file(s)
This command can be used to browse the con-
tents of the specified file. Scroll half a screen page up or down with




PgUp
and




PgDn
or a full screen page down with




Space
. Jump to the beginning
or end of a file using




Home
and




End
. Press




Q
to exit the program.
grep [option(s)] searchstring filenames
The grep command finds a specific search string in the specified
file(s)
.
If the search string is found, the command displays the line in which the
searchstring
was found along with the filename.
264
19.3. Important Linux Commands