
find | 155
Linux
Commands
This is the Title of the Book, eMatter Edition
Copyright © 2006 O’Reilly & Associates, Inc. All rights reserved.
-s Check files that are block or character special files in addition
to checking ordinary files.
-v Print the version.
-z Attempt checking of compressed files.
Many file types are understood. Output lists each filename,
followed by a brief classification such as:
ascii text
c program text
c-shell commands
data
empty
iAPX 386 executable
directory
[nt]roff, tbl, or eqn input text
shell commands
symbolic link to ../usr/etc/arp
Example
List all files that are deemed to be troff/nroff input:
file * | grep roff
find
find [pathnames] [conditions]
An extremely useful command for finding particular groups of files
(numerous examples follow this description). find descends the
directory tree beginning at each pathname and locates files that
meet the specified conditions. The default pathname is the current
directory. The most useful conditions include -name and -type
(for general use), -exec and -size (for advanced use), and -mtime
and -user (for administrators).
Conditions may be grouped by enclosing them in \( \) (escaped
parentheses), negated with !, given as alternatives by separating
them with -o, or repeated (adding restrictions to the match; usually
only for -name, -type,or-perm). Note that “modification” refers to
editing of a file’s contents, whereas “change” means a modifica- ...