* debian.rules: now creates *.architecture.deb
[findutils.git] / doc / find.info-2
blobd74f5945b6401f2c88ab8093bdad2af001bf5c12
1 This is Info file find.info, produced by Makeinfo-1.64 from the input
2 file find.texi.
4 START-INFO-DIR-ENTRY
5 * Finding Files: (find).        Listing and operating on files
6                                 that match certain criteria.
7 END-INFO-DIR-ENTRY
9    This file documents the GNU utilities for finding files that match
10 certain criteria and performing various operations on them.
12    Copyright (C) 1994 Free Software Foundation, Inc.
14    Permission is granted to make and distribute verbatim copies of this
15 manual provided the copyright notice and this permission notice are
16 preserved on all copies.
18    Permission is granted to copy and distribute modified versions of
19 this manual under the conditions for verbatim copying, provided that
20 the entire resulting derived work is distributed under the terms of a
21 permission notice identical to this one.
23    Permission is granted to copy and distribute translations of this
24 manual into another language, under the above conditions for modified
25 versions, except that this permission notice may be stated in a
26 translation approved by the Foundation.
28 \x1f
29 File: find.info,  Node: Viewing And Editing,  Next: Archiving,  Up: Common Tasks
31 Viewing And Editing
32 ===================
34    To view a list of files that meet certain criteria, simply run your
35 file viewing program with the file names as arguments.  Shells
36 substitute a command enclosed in backquotes with its output, so the
37 whole command looks like this:
39      less `find /usr/include -name '*.h' | xargs grep -l mode_t`
41 You can edit those files by giving an editor name instead of a file
42 viewing program.
44 \x1f
45 File: find.info,  Node: Archiving,  Next: Cleaning Up,  Prev: Viewing And Editing,  Up: Common Tasks
47 Archiving
48 =========
50    You can pass a list of files produced by `find' to a file archiving
51 program.  GNU `tar' and `cpio' can both read lists of file names from
52 the standard input--either delimited by nulls (the safe way) or by
53 blanks (the lazy, risky default way).  To use null-delimited names,
54 give them the `--null' option.  You can store a file archive in a file,
55 write it on a tape, or send it over a network to extract on another
56 machine.
58    One common use of `find' to archive files is to send a list of the
59 files in a directory tree to `cpio'.  Use `-depth' so if a directory
60 does not have write permission for its owner, its contents can still be
61 restored from the archive since the directory's permissions are
62 restored after its contents.  Here is an example of doing this using
63 `cpio'; you could use a more complex `find' expression to archive only
64 certain files.
66      find . -depth -print0 |
67        cpio --create --null --format=crc --file=/dev/nrst0
69    You could restore that archive using this command:
71      cpio --extract --null --make-dir --unconditional \
72        --preserve --file=/dev/nrst0
74    Here are the commands to do the same things using `tar':
76      find . -depth -print0 |
77        tar --create --null --files-from=- --file=/dev/nrst0
78      
79      tar --extract --null --preserve-perm --same-owner \
80        --file=/dev/nrst0
82    Here is an example of copying a directory from one machine to
83 another:
85      find . -depth -print0 | cpio -0o -Hnewc |
86        rsh OTHER-MACHINE "cd `pwd` && cpio -i0dum"
88 \x1f
89 File: find.info,  Node: Cleaning Up,  Next: Strange File Names,  Prev: Archiving,  Up: Common Tasks
91 Cleaning Up
92 ===========
94    This section gives examples of removing unwanted files in various
95 situations.  Here is a command to remove the CVS backup files created
96 when an update requires a merge:
98      find . -name '.#*' -print0 | xargs -0r rm -f
100    You can run this command to clean out your clutter in `/tmp'.  You
101 might place it in the file your shell runs when you log out
102 (`.bash_logout', `.logout', or `.zlogout', depending on which shell you
103 use).
105      find /tmp -user $LOGNAME -type f -print0 | xargs -0 -r rm -f
107    To remove old Emacs backup and auto-save files, you can use a command
108 like the following.  It is especially important in this case to use
109 null-terminated file names because Emacs packages like the VM mailer
110 often create temporary file names with spaces in them, like `#reply to
111 David J. MacKenzie<1>#'.
113      find ~ \( -name '*~' -o -name '#*#' \) -print0 |
114        xargs --no-run-if-empty --null rm -vf
116    Removing old files from `/tmp' is commonly done from `cron':
118      find /tmp /var/tmp -not -type d -mtime +3 -print0 |
119        xargs --null --no-run-if-empty rm -f
120      
121      find /tmp /var/tmp -depth -mindepth 1 -type d -empty -print0 |
122        xargs --null --no-run-if-empty rmdir
124    The second `find' command above uses `-depth' so it cleans out empty
125 directories depth-first, hoping that the parents become empty and can
126 be removed too.  It uses `-mindepth' to avoid removing `/tmp' itself if
127 it becomes totally empty.
129 \x1f
130 File: find.info,  Node: Strange File Names,  Next: Fixing Permissions,  Prev: Cleaning Up,  Up: Common Tasks
132 Strange File Names
133 ==================
135    `find' can help you remove or rename a file with strange characters
136 in its name.  People are sometimes stymied by files whose names contain
137 characters such as spaces, tabs, control characters, or characters with
138 the high bit set.  The simplest way to remove such files is:
140      rm -i SOME*PATTERN*THAT*MATCHES*THE*PROBLEM*FILE
142    `rm' asks you whether to remove each file matching the given
143 pattern.  If you are using an old shell, this approach might not work if
144 the file name contains a character with the high bit set; the shell may
145 strip it off.  A more reliable way is:
147      find . -maxdepth 1 TESTS -ok rm '{}' \;
149 where TESTS uniquely identify the file.  The `-maxdepth 1' option
150 prevents `find' from wasting time searching for the file in any
151 subdirectories; if there are no subdirectories, you may omit it.  A
152 good way to uniquely identify the problem file is to figure out its
153 inode number; use
155      ls -i
157    Suppose you have a file whose name contains control characters, and
158 you have found that its inode number is 12345.  This command prompts
159 you for whether to remove it:
161      find . -maxdepth 1 -inum 12345 -ok rm -f '{}' \;
163    If you don't want to be asked, perhaps because the file name may
164 contain a strange character sequence that will mess up your screen when
165 printed, then use `-exec' instead of `-ok'.
167    If you want to rename the file instead, you can use `mv' instead of
168 `rm':
170      find . -maxdepth 1 -inum 12345 -ok mv '{}' NEW-FILE-NAME \;
172 \x1f
173 File: find.info,  Node: Fixing Permissions,  Next: Classifying Files,  Prev: Strange File Names,  Up: Common Tasks
175 Fixing Permissions
176 ==================
178    Suppose you want to make sure that everyone can write to the
179 directories in a certain directory tree.  Here is a way to find
180 directories lacking either user or group write permission (or both),
181 and fix their permissions:
183      find . -type d -not -perm -ug=w | xargs chmod ug+w
185 You could also reverse the operations, if you want to make sure that
186 directories do *not* have world write permission.
188 \x1f
189 File: find.info,  Node: Classifying Files,  Prev: Fixing Permissions,  Up: Common Tasks
191 Classifying Files
192 =================
194    If you want to classify a set of files into several groups based on
195 different criteria, you can use the comma operator to perform multiple
196 independent tests on the files.  Here is an example:
198      find / -type d \( -perm -o=w -fprint allwrite , \
199        -perm -o=x -fprint allexec \)
200      
201      echo "Directories that can be written to by everyone:"
202      cat allwrite
203      echo ""
204      echo "Directories with search permissions for everyone:"
205      cat allexec
207    `find' has only to make one scan through the directory tree (which
208 is one of the most time consuming parts of its work).
210 \x1f
211 File: find.info,  Node: Databases,  Next: File Permissions,  Prev: Common Tasks,  Up: Top
213 File Name Databases
214 *******************
216    The file name databases used by `locate' contain lists of files that
217 were in particular directory trees when the databases were last
218 updated.  The file name of the default database is determined when
219 `locate' and `updatedb' are configured and installed.  The frequency
220 with which the databases are updated and the directories for which they
221 contain entries depend on how often `updatedb' is run, and with which
222 arguments.
224 * Menu:
226 * Database Locations::
227 * Database Formats::
229 \x1f
230 File: find.info,  Node: Database Locations,  Next: Database Formats,  Up: Databases
232 Database Locations
233 ==================
235    There can be multiple file name databases.  Users can select which
236 databases `locate' searches using an environment variable or a command
237 line option.  The system administrator can choose the file name of the
238 default database, the frequency with which the databases are updated,
239 and the directories for which they contain entries.  File name
240 databases are updated by running the `updatedb' program, typically
241 nightly.
243    In networked environments, it often makes sense to build a database
244 at the root of each filesystem, containing the entries for that
245 filesystem.  `updatedb' is then run for each filesystem on the
246 fileserver where that filesystem is on a local disk, to prevent
247 thrashing the network.  Here are the options to `updatedb' to select
248 which directories each database contains entries for:
250 `--localpaths='PATH...''
251      Non-network directories to put in the database.  Default is `/'.
253 `--netpaths='PATH...''
254      Network (NFS, AFS, RFS, etc.) directories to put in the database.
255      Default is none.
257 `--prunepaths='PATH...''
258      Directories to not put in the database, which would otherwise be.
259      Default is `/tmp /usr/tmp /var/tmp /afs /amd /net /alex'.
261 `--output=DBFILE'
262      The database file to build.  Default is system-dependent, but
263      typically `/usr/local/var/locatedb'.
265 `--netuser=USER'
266      The user to search network directories as, using `su'.  Default is
267      `daemon'.
269 \x1f
270 File: find.info,  Node: Database Formats,  Prev: Database Locations,  Up: Databases
272 Database Formats
273 ================
275    The file name databases contain lists of files that were in
276 particular directory trees when the databases were last updated.  The
277 file name database format changed starting with GNU `locate' version
278 4.0 to allow machines with diffent byte orderings to share the
279 databases.  The new GNU `locate' can read both the old and new database
280 formats.  However, old versions of `locate' and `find' produce incorrect
281 results if given a new-format database.
283 * Menu:
285 * New Database Format::
286 * Sample Database::
287 * Old Database Format::
289 \x1f
290 File: find.info,  Node: New Database Format,  Next: Sample Database,  Up: Database Formats
292 New Database Format
293 -------------------
295    `updatedb' runs a program called `frcode' to "front-compress" the
296 list of file names, which reduces the database size by a factor of 4 to
297 5.  Front-compression (also known as incremental encoding) works as
298 follows.
300    The database entries are a sorted list (case-insensitively, for
301 users' convenience).  Since the list is sorted, each entry is likely to
302 share a prefix (initial string) with the previous entry.  Each database
303 entry begins with an offset-differential count byte, which is the
304 additional number of characters of prefix of the preceding entry to use
305 beyond the number that the preceding entry is using of its predecessor.
306 (The counts can be negative.)  Following the count is a
307 null-terminated ASCII remainder--the part of the name that follows the
308 shared prefix.
310    If the offset-differential count is larger than can be stored in a
311 byte (+/-127), the byte has the value 0x80 and the count follows in a
312 2-byte word, with the high byte first (network byte order).
314    Every database begins with a dummy entry for a file called
315 `LOCATE02', which `locate' checks for to ensure that the database file
316 has the correct format; it ignores the entry in doing the search.
318    Databases can not be concatenated together, even if the first (dummy)
319 entry is trimmed from all but the first database.  This is because the
320 offset-differential count in the first entry of the second and following
321 databases will be wrong.
323 \x1f
324 File: find.info,  Node: Sample Database,  Next: Old Database Format,  Prev: New Database Format,  Up: Database Formats
326 Sample Database
327 ---------------
329    Sample input to `frcode':
331      /usr/src
332      /usr/src/cmd/aardvark.c
333      /usr/src/cmd/armadillo.c
334      /usr/tmp/zoo
336    Length of the longest prefix of the preceding entry to share:
338      0 /usr/src
339      8 /cmd/aardvark.c
340      14 rmadillo.c
341      5 tmp/zoo
343    Output from `frcode', with trailing nulls changed to newlines and
344 count bytes made printable:
346      0 LOCATE02
347      0 /usr/src
348      8 /cmd/aardvark.c
349      6 rmadillo.c
350      -9 tmp/zoo
352    (6 = 14 - 8, and -9 = 5 - 14)
354 \x1f
355 File: find.info,  Node: Old Database Format,  Prev: Sample Database,  Up: Database Formats
357 Old Database Format
358 -------------------
360    The old database format is used by Unix `locate' and `find' programs
361 and earlier releases of the GNU ones.  `updatedb' produces this format
362 if given the `--old-format' option.
364    `updatedb' runs programs called `bigram' and `code' to produce
365 old-format databases.  The old format differs from the new one in the
366 following ways.  Instead of each entry starting with an
367 offset-differential count byte and ending with a null, byte values from
368 0 through 28 indicate offset-differential counts from -14 through 14.
369 The byte value indicating that a long offset-differential count follows
370 is 0x1e (30), not 0x80.  The long counts are stored in host byte order,
371 which is not necessarily network byte order, and host integer word size,
372 which is usually 4 bytes.  They also represent a count 14 less than
373 their value.  The database lines have no termination byte; the start of
374 the next line is indicated by its first byte having a value <= 30.
376    In addition, instead of starting with a dummy entry, the old database
377 format starts with a 256 byte table containing the 128 most common
378 bigrams in the file list.  A bigram is a pair of adjacent bytes.  Bytes
379 in the database that have the high bit set are indexes (with the high
380 bit cleared) into the bigram table.  The bigram and offset-differential
381 count coding makes these databases 20-25% smaller than the new format,
382 but makes them not 8-bit clean.  Any byte in a file name that is in the
383 ranges used for the special codes is replaced in the database by a
384 question mark, which not coincidentally is the shell wildcard to match a
385 single character.
387 \x1f
388 File: find.info,  Node: File Permissions,  Next: Reference,  Prev: Databases,  Up: Top
390 File Permissions
391 ****************
393    Each file has a set of "permissions" that control the kinds of
394 access that users have to that file.  The permissions for a file are
395 also called its "access mode".  They can be represented either in
396 symbolic form or as an octal number.
398 * Menu:
400 * Mode Structure::              Structure of file permissions.
401 * Symbolic Modes::              Mnemonic permissions representation.
402 * Numeric Modes::               Permissions as octal numbers.
404 \x1f
405 File: find.info,  Node: Mode Structure,  Next: Symbolic Modes,  Up: File Permissions
407 Structure of File Permissions
408 =============================
410    There are three kinds of permissions that a user can have for a file:
412   1. permission to read the file.  For directories, this means
413      permission to list the contents of the directory.
415   2. permission to write to (change) the file.  For directories, this
416      means permission to create and remove files in the directory.
418   3. permission to execute the file (run it as a program).  For
419      directories, this means permission to access files in the
420      directory.
422    There are three categories of users who may have different
423 permissions to perform any of the above operations on a file:
425   1. the file's owner;
427   2. other users who are in the file's group;
429   3. everyone else.
431    Files are given an owner and group when they are created.  Usually
432 the owner is the current user and the group is the group of the
433 directory the file is in, but this varies with the operating system, the
434 filesystem the file is created on, and the way the file is created.  You
435 can change the owner and group of a file by using the `chown' and
436 `chgrp' commands.
438    In addition to the three sets of three permissions listed above, a
439 file's permissions have three special components, which affect only
440 executable files (programs) and, on some systems, directories:
442   1. set the process's effective user ID to that of the file upon
443      execution (called the "setuid bit").  No effect on directories.
445   2. set the process's effective group ID to that of the file upon
446      execution (called the "setgid bit").  For directories on some
447      systems, put files created in the directory into the same group as
448      the directory, no matter what group the user who creates them is
449      in.
451   3. save the program's text image on the swap device so it will load
452      more quickly when run (called the "sticky bit").  For directories
453      on some systems, prevent users from removing files that they do
454      not own in the directory; this is called making the directory
455      "append-only".
457 \x1f
458 File: find.info,  Node: Symbolic Modes,  Next: Numeric Modes,  Prev: Mode Structure,  Up: File Permissions
460 Symbolic Modes
461 ==============
463    "Symbolic modes" represent changes to files' permissions as
464 operations on single-character symbols.  They allow you to modify either
465 all or selected parts of files' permissions, optionally based on their
466 previous values, and perhaps on the current `umask' as well (*note
467 Umask and Protection::.).
469    The format of symbolic modes is:
471      [ugoa...][[+-=][rwxXstugo...]...][,...]
473    The following sections describe the operators and other details of
474 symbolic modes.
476 * Menu:
478 * Setting Permissions::          Basic operations on permissions.
479 * Copying Permissions::          Copying existing permissions.
480 * Changing Special Permissions:: Special permissions.
481 * Conditional Executability::    Conditionally affecting executability.
482 * Multiple Changes::             Making multiple changes.
483 * Umask and Protection::              The effect of the umask.
485 \x1f
486 File: find.info,  Node: Setting Permissions,  Next: Copying Permissions,  Up: Symbolic Modes
488 Setting Permissions
489 -------------------
491    The basic symbolic operations on a file's permissions are adding,
492 removing, and setting the permission that certain users have to read,
493 write, and execute the file.  These operations have the following
494 format:
496      USERS OPERATION PERMISSIONS
498 The spaces between the three parts above are shown for readability only;
499 symbolic modes can not contain spaces.
501    The USERS part tells which users' access to the file is changed.  It
502 consists of one or more of the following letters (or it can be empty;
503 *note Umask and Protection::., for a description of what happens then).
504 When more than one of these letters is given, the order that they are
505 in does not matter.
508      the user who owns the file;
511      other users who are in the file's group;
514      all other users;
517      all users; the same as `ugo'.
519    The OPERATION part tells how to change the affected users' access to
520 the file, and is one of the following symbols:
523      to add the PERMISSIONS to whatever permissions the USERS already
524      have for the file;
527      to remove the PERMISSIONS from whatever permissions the USERS
528      already have for the file;
531      to make the PERMISSIONS the only permissions that the USERS have
532      for the file.
534    The PERMISSIONS part tells what kind of access to the file should be
535 changed; it is zero or more of the following letters.  As with the
536 USERS part, the order does not matter when more than one letter is
537 given.  Omitting the PERMISSIONS part is useful only with the `='
538 operation, where it gives the specified USERS no access at all to the
539 file.
542      the permission the USERS have to read the file;
545      the permission the USERS have to write to the file;
548      the permission the USERS have to execute the file.
550    For example, to give everyone permission to read and write a file,
551 but not to execute it, use:
553      a=rw
555    To remove write permission for from all users other than the file's
556 owner, use:
558      go-w
560 The above command does not affect the access that the owner of the file
561 has to it, nor does it affect whether other users can read or execute
562 the file.
564    To give everyone except a file's owner no permission to do anything
565 with that file, use the mode below.  Other users could still remove the
566 file, if they have write permission on the directory it is in.
568      go=
570 Another way to specify the same thing is:
572      og-rxw
574 \x1f
575 File: find.info,  Node: Copying Permissions,  Next: Changing Special Permissions,  Prev: Setting Permissions,  Up: Symbolic Modes
577 Copying Existing Permissions
578 ----------------------------
580    You can base part of a file's permissions on part of its existing
581 permissions.  To do this, instead of using `r', `w', or `x' after the
582 operator, you use the letter `u', `g', or `o'.  For example, the mode
584      o+g
586 adds the permissions for users who are in a file's group to the
587 permissions that other users have for the file.  Thus, if the file
588 started out as mode 664 (`rw-rw-r--'), the above mode would change it
589 to mode 666 (`rw-rw-rw-').  If the file had started out as mode 741
590 (`rwxr----x'), the above mode would change it to mode 745
591 (`rwxr--r-x').  The `-' and `=' operations work analogously.
593 \x1f
594 File: find.info,  Node: Changing Special Permissions,  Next: Conditional Executability,  Prev: Copying Permissions,  Up: Symbolic Modes
596 Changing Special Permissions
597 ----------------------------
599    In addition to changing a file's read, write, and execute
600 permissions, you can change its special permissions.  *Note Mode
601 Structure::, for a summary of these permissions.
603    To change a file's permission to set the user ID on execution, use
604 `u' in the USERS part of the symbolic mode and `s' in the PERMISSIONS
605 part.
607    To change a file's permission to set the group ID on execution, use
608 `g' in the USERS part of the symbolic mode and `s' in the PERMISSIONS
609 part.
611    To change a file's permission to stay permanently on the swap device,
612 use `o' in the USERS part of the symbolic mode and `t' in the
613 PERMISSIONS part.
615    For example, to add set user ID permission to a program, you can use
616 the mode:
618      u+s
620    To remove both set user ID and set group ID permission from it, you
621 can use the mode:
623      ug-s
625    To cause a program to be saved on the swap device, you can use the
626 mode:
628      o+t
630    Remember that the special permissions only affect files that are
631 executable, plus, on some systems, directories (on which they have
632 different meanings; *note Mode Structure::.).  Using `a' in the USERS
633 part of a symbolic mode does not cause the special permissions to be
634 affected; thus,
636      a+s
638 has *no effect*.  You must use `u', `g', and `o' explicitly to affect
639 the special permissions.  Also, the combinations `u+t', `g+t', and
640 `o+s' have no effect.
642    The `=' operator is not very useful with special permissions; for
643 example, the mode:
645      o=t
647 does cause the file to be saved on the swap device, but it also removes
648 all read, write, and execute permissions that users not in the file's
649 group might have had for it.
651 \x1f
652 File: find.info,  Node: Conditional Executability,  Next: Multiple Changes,  Prev: Changing Special Permissions,  Up: Symbolic Modes
654 Conditional Executability
655 -------------------------
657    There is one more special type of symbolic permission: if you use
658 `X' instead of `x', execute permission is affected only if the file
659 already had execute permission or is a directory.  It affects
660 directories' execute permission even if they did not initially have any
661 execute permissions set.
663    For example, this mode:
665      a+X
667 gives all users permission to execute files (or search directories) if
668 anyone could before.
670 \x1f
671 File: find.info,  Node: Multiple Changes,  Next: Umask and Protection,  Prev: Conditional Executability,  Up: Symbolic Modes
673 Making Multiple Changes
674 -----------------------
676    The format of symbolic modes is actually more complex than described
677 above (*note Setting Permissions::.).  It provides two ways to make
678 multiple changes to files' permissions.
680    The first way is to specify multiple OPERATION and PERMISSIONS parts
681 after a USERS part in the symbolic mode.
683    For example, the mode:
685      og+rX-w
687 gives users other than the owner of the file read permission and, if it
688 is a directory or if someone already had execute permission to it,
689 gives them execute permission; and it also denies them write permission
690 to it file.  It does not affect the permission that the owner of the
691 file has for it.  The above mode is equivalent to the two modes:
693      og+rX
694      og-w
696    The second way to make multiple changes is to specify more than one
697 simple symbolic mode, separated by commas.  For example, the mode:
699      a+r,go-w
701 gives everyone permission to read the file and removes write permission
702 on it for all users except its owner.  Another example:
704      u=rwx,g=rx,o=
706 sets all of the non-special permissions for the file explicitly.  (It
707 gives users who are not in the file's group no permission at all for
708 it.)
710    The two methods can be combined.  The mode:
712      a+r,g+x-w
714 gives all users permission to read the file, and gives users who are in
715 the file's group permission to execute it, as well, but not permission
716 to write to it.  The above mode could be written in several different
717 ways; another is:
719      u+r,g+rx,o+r,g-w
721 \x1f
722 File: find.info,  Node: Umask and Protection,  Prev: Multiple Changes,  Up: Symbolic Modes
724 The Umask and Protection
725 ------------------------
727    If the USERS part of a symbolic mode is omitted, it defaults to `a'
728 (affect all users), except that any permissions that are *set* in the
729 system variable `umask' are *not affected*.  The value of `umask' can
730 be set using the `umask' command.  Its default value varies from system
731 to system.
733    Omitting the USERS part of a symbolic mode is generally not useful
734 with operations other than `+'.  It is useful with `+' because it
735 allows you to use `umask' as an easily customizable protection against
736 giving away more permission to files than you intended to.
738    As an example, if `umask' has the value 2, which removes write
739 permission for users who are not in the file's group, then the mode:
741      +w
743 adds permission to write to the file to its owner and to other users who
744 are in the file's group, but *not* to other users.  In contrast, the
745 mode:
747      a+w
749 ignores `umask', and *does* give write permission for the file to all
750 users.
752 \x1f
753 File: find.info,  Node: Numeric Modes,  Prev: Symbolic Modes,  Up: File Permissions
755 Numeric Modes
756 =============
758    File permissions are stored internally as 16 bit integers.  As an
759 alternative to giving a symbolic mode, you can give an octal (base 8)
760 number that corresponds to the internal representation of the new mode.
761 This number is always interpreted in octal; you do not have to add a
762 leading 0, as you do in C.  Mode 0055 is the same as mode 55.
764    A numeric mode is usually shorter than the corresponding symbolic
765 mode, but it is limited in that it can not take into account a file's
766 previous permissions; it can only set them absolutely.
768    The permissions granted to the user, to other users in the file's
769 group, and to other users not in the file's group are each stored as
770 three bits, which are represented as one octal digit.  The three special
771 permissions are also each stored as one bit, and they are as a group
772 represented as another octal digit.  Here is how the bits are arranged
773 in the 16 bit integer, starting with the lowest valued bit:
775      Value in  Corresponding
776      Mode      Permission
777      
778                Other users not in the file's group:
779         1      Execute
780         2      Write
781         4      Read
782      
783                Other users in the file's group:
784        10      Execute
785        20      Write
786        40      Read
787      
788                The file's owner:
789       100      Execute
790       200      Write
791       400      Read
792      
793                Special permissions:
794      1000      Save text image on swap device
795      2000      Set group ID on execution
796      4000      Set user ID on execution
798    For example, numeric mode 4755 corresponds to symbolic mode
799 `u=rwxs,go=rx', and numeric mode 664 corresponds to symbolic mode
800 `ug=rw,o=r'.  Numeric mode 0 corresponds to symbolic mode `ugo='.
802 \x1f
803 File: find.info,  Node: Reference,  Next: Primary Index,  Prev: File Permissions,  Up: Top
805 Reference
806 *********
808    Below are summaries of the command line syntax for the programs
809 discussed in this manual.
811 * Menu:
813 * Invoking find::
814 * Invoking locate::
815 * Invoking updatedb::
816 * Invoking xargs::
818 \x1f
819 File: find.info,  Node: Invoking find,  Next: Invoking locate,  Up: Reference
821 Invoking `find'
822 ===============
824      find [FILE...] [EXPRESSION]
826    `find' searches the directory tree rooted at each file name FILE by
827 evaluating the EXPRESSION on each file it finds in the tree.
829    `find' considers the first argument that begins with `-', `(', `)',
830 `,', or `!' to be the beginning of the expression; any arguments before
831 it are paths to search, and any arguments after it are the rest of the
832 expression.  If no paths are given, the current directory is used.  If
833 no expression is given, the expression `-print' is used.
835    `find' exits with status 0 if all files are processed successfully,
836 greater than 0 if errors occur.
838    *Note Primary Index::, for a summary of all of the tests, actions,
839 and options that the expression can contain.
841    `find' also recognizes two options for administrative use:
843 `--help'
844      Print a summary of the command-line argument format and exit.
846 `--version'
847      Print the version number of `find' and exit.
849 \x1f
850 File: find.info,  Node: Invoking locate,  Next: Invoking updatedb,  Prev: Invoking find,  Up: Reference
852 Invoking `locate'
853 =================
855      locate [OPTION...] PATTERN...
857 `--database=PATH'
858 `-d PATH'
859      Instead of searching the default file name database, search the
860      file name databases in PATH, which is a colon-separated list of
861      database file names.  You can also use the environment variable
862      `LOCATE_PATH' to set the list of database files to search.  The
863      option overrides the environment variable if both are used.
865 `--help'
866      Print a summary of the options to `locate' and exit.
868 `--version'
869      Print the version number of `locate' and exit.
871 \x1f
872 File: find.info,  Node: Invoking updatedb,  Next: Invoking xargs,  Prev: Invoking locate,  Up: Reference
874 Invoking `updatedb'
875 ===================
877      updatedb [OPTION...]
879 `--localpaths='PATH...''
880      Non-network directories to put in the database.  Default is `/'.
882 `--netpaths='PATH...''
883      Network (NFS, AFS, RFS, etc.) directories to put in the database.
884      Default is none.
886 `--prunepaths='PATH...''
887      Directories to not put in the database, which would otherwise be.
888      Default is `/tmp /usr/tmp /var/tmp /afs'.
890 `--output=DBFILE'
891      The database file to build.  Default is system-dependent, but
892      typically `/usr/local/var/locatedb'.
894 `--netuser=USER'
895      The user to search network directories as, using `su'(1).  Default
896      is `daemon'.
898 \x1f
899 File: find.info,  Node: Invoking xargs,  Prev: Invoking updatedb,  Up: Reference
901 Invoking `xargs'
902 ================
904      xargs [OPTION...] [COMMAND [INITIAL-ARGUMENTS]]
906    `xargs' exits with the following status:
909      if it succeeds
912      if any invocation of the command exited with status 1-125
915      if the command exited with status 255
918      if the command is killed by a signal
921      if the command cannot be run
924      if the command is not found
927      if some other error occurred.
929 `--null'
930 `-0'
931      Input filenames are terminated by a null character instead of by
932      whitespace, and the quotes and backslash are not special (every
933      character is taken literally).  Disables the end of file string,
934      which is treated like any other argument.
936 `--eof[=EOF-STR]'
937 `-e[EOF-STR]'
938      Set the end of file string to EOF-STR.  If the end of file string
939      occurs as a line of input, the rest of the input is ignored.  If
940      EOF-STR is omitted, there is no end of file string.  If this
941      option is not given, the end of file string defaults to `_'.
943 `--help'
944      Print a summary of the options to `xargs' and exit.
946 `--replace[=REPLACE-STR]'
947 `-i[REPLACE-STR]'
948      Replace occurences of REPLACE-STR in the initial arguments with
949      names read from standard input.  Also, unquoted blanks do not
950      terminate arguments.  If REPLACE-STR is omitted, it defaults to
951      `{}' (like for `find -exec').  Implies `-x' and `-l 1'.
953 `--max-lines[=MAX-LINES]'
954 `-l[MAX-LINES]'
955      Use at most MAX-LINES nonblank input lines per command line;
956      MAX-LINES defaults to 1 if omitted.  Trailing blanks cause an
957      input line to be logically continued on the next input line, for
958      the purpose of counting the lines.  Implies `-x'.
960 `--max-args=MAX-ARGS'
961 `-n MAX-ARGS'
962      Use at most MAX-ARGS arguments per command line.  Fewer than
963      MAX-ARGS arguments will be used if the size (see the `-s' option)
964      is exceeded, unless the `-x' option is given, in which case
965      `xargs' will exit.
967 `--interactive'
968 `-p'
969      Prompt the user about whether to run each command line and read a
970      line from the terminal.  Only run the command line if the response
971      starts with `y' or `Y'.  Implies `-t'.
973 `--no-run-if-empty'
974 `-r'
975      If the standard input does not contain any nonblanks, do not run
976      the command.  By default, the command is run once even if there is
977      no input.
979 `--max-chars=MAX-CHARS'
980 `-s MAX-CHARS'
981      Use at most MAX-CHARS characters per command line, including the
982      command and initial arguments and the terminating nulls at the
983      ends of the argument strings.
985 `--verbose'
986 `-t'
987      Print the command line on the standard error output before
988      executing it.
990 `--version'
991      Print the version number of `xargs' and exit.
993 `--exit'
994 `-x'
995      Exit if the size (see the -S option) is exceeded.
997 `--max-procs=MAX-PROCS'
998 `-P MAX-PROCS'
999      Run up to MAX-PROCS processes at a time; the default is 1.  If
1000      MAX-PROCS is 0, `xargs' will run as many processes as possible at
1001      a time.
1003 \x1f
1004 File: find.info,  Node: Primary Index,  Prev: Reference,  Up: Top
1006 `find' Primary Index
1007 ********************
1009    This is a list of all of the primaries (tests, actions, and options)
1010 that make up `find' expressions for selecting files.  *Note find
1011 Expressions::, for more information on expressions.
1013 * Menu:
1015 * -amin:                                Age Ranges.
1016 * -anewer:                              Comparing Timestamps.
1017 * -atime:                               Age Ranges.
1018 * -cmin:                                Age Ranges.
1019 * -cnewer:                              Comparing Timestamps.
1020 * -ctime:                               Age Ranges.
1021 * -daystart:                            Age Ranges.
1022 * -depth:                               Directories.
1023 * -empty:                               Size.
1024 * -exec:                                Single File.
1025 * -false:                               Combining Primaries With Operators.
1026 * -fls:                                 Print File Information.
1027 * -follow:                              Symbolic Links.
1028 * -fprint:                              Print File Name.
1029 * -fprint0:                             Safe File Name Handling.
1030 * -fprintf:                             Print File Information.
1031 * -fstype:                              Filesystems.
1032 * -gid:                                 Owner.
1033 * -group:                               Owner.
1034 * -ilname:                              Symbolic Links.
1035 * -iname:                               Base Name Patterns.
1036 * -inum:                                Hard Links.
1037 * -ipath:                               Full Name Patterns.
1038 * -iregex:                              Full Name Patterns.
1039 * -links:                               Hard Links.
1040 * -lname:                               Symbolic Links.
1041 * -ls:                                  Print File Information.
1042 * -maxdepth:                            Directories.
1043 * -mindepth:                            Directories.
1044 * -mmin:                                Age Ranges.
1045 * -mount:                               Filesystems.
1046 * -mtime:                               Age Ranges.
1047 * -name:                                Base Name Patterns.
1048 * -newer:                               Comparing Timestamps.
1049 * -nogroup:                             Owner.
1050 * -noleaf:                              Directories.
1051 * -nouser:                              Owner.
1052 * -ok:                                  Querying.
1053 * -path:                                Full Name Patterns.
1054 * -perm:                                Permissions.
1055 * -print:                               Print File Name.
1056 * -print0:                              Safe File Name Handling.
1057 * -printf:                              Print File Information.
1058 * -prune:                               Directories.
1059 * -regex:                               Full Name Patterns.
1060 * -size:                                Size.
1061 * -true:                                Combining Primaries With Operators.
1062 * -type:                                Type.
1063 * -uid:                                 Owner.
1064 * -used:                                Comparing Timestamps.
1065 * -user:                                Owner.
1066 * -xdev:                                Filesystems.
1067 * -xtype:                               Type.