find(1l)


NÉV

find - file-ok keresése a könyvtárrendszerben

HASZNÁLAT

find [út...] [kifejezés]

LEÍRÁS

Ez a kézikönyv a find GNU verzióját írja le. find a könyvtárrendszerben keres minden megadott file nevet, a megadott kifejezést balról jobbra kiértékelve , az elsõbbségi szabályok szerint (lásd az OPERÁTOROK részt), míg az eredmény ismert ( a bal oldal hamis az és mûveletekre, és igaz vagy esetén), ezen a ponton a find a következõ file névre ugrik.

Az elsõ argumentum ami `-', `(', `)', `,', vagy `!' jellel kezdõdik tegyük a kifejezés kezdetére; minden argumentum ez elõtt út a kereséshez, és minden argumentum ezután a kifejezés további része. Ha nem adunk meg utat, az aktuális könyvtárat használjuk. Ha nem adunk meg kifejezést, a `-print' kifejezést használjuk.

find 0 státusszal lép ki, ha a minden file-on sikeresen végrehajtódott, nagyobb mint 0-val, ha hiba ált elõ.

KIFEJEZÉSEK

A kifejezés az kapcsolókat egészíti ki (amik minden mûveletre hatnak, nem csak a meghatározott file feldolgozására, és mindig igaz értékkel térnek vissza), tesztek (amik igaz vagy hamis értékkel térnek vissza), és eljárások (amiknek van más hatásuk is, és igaz vagy hamis értékkel térnek vissza), mind operátorokkal vannak elválasztva. -and szükséges ahol az operátort elhagyjuk. Ha a kifejezés nem tartalmaz más eljárást mint -prune, -print akkor minden file-on végrehajtódik, amire a kifejezés igaz.

KAPCSOLÓK

Minden kapcsoló mindig igaz értékkel tér vissza. Mindig van hatásuk, nem csak akkor hajtódnak végre ha a helyük a kifejezében elérhetõ. Ezért a világosság kedvéért a legjobb ha a kifejezés elejére helyezzük õket.

-daystart
Idõmérték (-amin, -atime, -cmin, -ctime, -mmin, és -mtime) az aktuális nap kezdetétõl nem 24 órával ezelõtt-öl

-depth
Elõbb minden könyvtárnak a tartalmát dolgozza fel mielõtt a könyvtárat magát.

-follow
Visszautal a szimbolikus kapcsolatokra. Tartalmazza a -noleaf-ot. .

-help, --help
Kiírja a find parancssorának a kezelésének az összefoglalóját, és kilép.

-maxdepth szintek
Leereszkedik egészen szintek (egy nem negatív egész) szinttel a könyvtárrendszerben a parancssor argumentumai alá. A `-maxdepth 0' azt jelenti, hogy a teszteket és eljárásokat csak a parancssor argumentumain alkalmazza.

-mindepth szinetk
Nem alkalmazza a teszteket és eljárásokat azokon a szinteken amik kisebbek mint szinetk (egy nem negatív egész). A `-mindepth 1' azt jelenti, hogy minden file-t feldolgoz, kivéve a parancssor argumentumait.

-mount
Don't descend directories on other filesystems. An alternate name for -xdev, for compatibility with some other versions of find .

-noleaf
Do not optimize by assuming that directories contain 2 fewer subdirectories than their hard link count. This option is needed when searching filesystems that do not follow the Unix directory-link convention, such as CD-ROM or MS-DOS filesystems or AFS volume mount points. Each directory on a normal Unix filesystem has at least 2 hard links: its name and its `.' entry. Additionally, its subdirectories (if any) each have a `..' entry linked to that directory. When find is examining a directory, after it has statted 2 fewer subdirectories than the directory's link count, it knows that the rest of the entries in the directory are non-directories (`leaf' files in the directory tree). If only the files' names need to be examined, there is no need to stat them; this gives a significant increase in search speed.

-version, --version
Print the find version number and exit.

-xdev
Don't descend directories on other filesystems.

TESTS

Numeric arguments can be specified as

+n
for greater than n ,

-n
for less than n ,

n
for exactly n .

-amin n
File was last accessed n minutes ago.

-anewer file
File was last accessed more recently than file was modified. -anewer is affected by -follow only if -follow comes before -anewer on the command line.

-atime n
File was last accessed n*24 hours ago.

-cmin n
File's status was last changed n minutes ago.

-cnewer file
File's status was last changed more recently than file was modified. -cnewer is affected by -follow only if -follow comes before -cnewer on the command line.

-ctime n
File's status was last changed n*24 hours ago.

-empty
File is empty and is either a regular file or a directory.

-false
Always false.

-fstype type
File is on a filesystem of type type. The valid filesystem types vary among different versions of Unix; an incomplete list of filesystem types that are accepted on some version of Unix or another is: ufs, 4.2, 4.3, nfs, tmp, mfs, S51K, S52K. You can use -printf with the %F directive to see the types of your filesystems.

-gid n
File's numeric group ID is n.

-group gname
File belongs to group gname (numeric group ID allowed).

-ilname pattern
Like -lname, but the match is case insensitive.

-iname minta
Ugyanaz mint -name, de az összehasonlítás nem veszi figyelembe a nagy- és kis-betû eltéréseket. Pl.: a 'fo*' és 'F??' minták mindegyike illik a 'Foo', 'FOO', 'foo', 'fOo', stb. nevekre is.

-inum n
A file n i-node-ú.

-ipath minta
Ugyanaz mint -path, de nem veszi figyelembe a kis- és nagy-betû eltéréseket.

-iregex minta
Ugyanaz mint -regex, de nem veszi figyelembe a kis- és nagy-betû eltéréseket.

-links n
A filenak n linkja van.

-lname minta
A file egy symbolic link, aminek a tartalma illik a minta mintára. A metakarakterek magukba foglalják a '/', '.' karaktereket.

-mmin n
A file utoljára n perce volt megváltoztatva.

-mtime n
A file utoljára n*24 orája volt változtatva..

-name minta
A file neve (az útvonal nélkül) illik a minta mintára. A metakarakterek ('*', '?', '[]') magukba foglalják a '.' karaktert a filenév elején. Ha figyelmenkívül akarjuk hagyni az abból nyíló file és könyvtárakat, akkor használjuk a -prune -t; lásd példa a -path -nál.

-newer file
A file frisseb, mint file. -newer befolyásolva van a -follow által, ha a -follow elôbb fordul elô mint a -newer a paracssorban.

-nouser
Nincs user akinek az ID-ja megegyezik a file ID-jával.

-nogroup
Nincs csoport akinek az ID-ja megegyezik a file ID-jával.

-path minta
A file neve illik a minta mintára. A metakarakterek magukba foglalják a '/' és '.' karaktereket. Példa:
find . -path './sr*sc'
ki fogja irni a './src/misc' könytárat (ha van). Ha figyelmenkívül akarjuk hagyni az alatta levô könyvtárakat, akkor használjuk a -prune -t. Pl.: Ha nem akarjuk nézni a '/src/emacs' könyvtárat, de minden alattalevôt igen, akkor valami ilyesmi lesz:
find . -path './src/emacs' -prune -o -print

-perm mode
A file jogai pontosan mode-nak felelnek meg. (oktális vagy szimbolikus). A szimbolikus mode-ok a 0-át használják kiindulási pontnak.

-perm -mode
A megadott bitek be vannak állítva a file-on.

-perm +mode
Valamelyik bit be van állítva a file-on.

-regex minta
A file neve illik a minta mintára. Ez az illeszt&eeacute;s az egész könyvtárra vonatkozik, nem keresés. Pl.: egy olyan file kiválasztása, hogy './fubar3', használható a '.*bar.', '.*b.*3', de nem az, hogy 'b.*r3'.

-size n[bckw]
A file n egysényi. Alapértelmezés szerint 1 egység 512 byte, vagy ha 'b' beállítva, n byte, ha 'c' van, n kilobyte, ha 'k' van, n word, ha 'w' van. The size does not count indirect blocks, but it does count blocks in sparse files that are not actually allocated.

-true
Always true.

-type c
File is of type c:

b
block (buffered) special

c
character (unbuffered) special

d
directory

p
named pipe (FIFO)

f
regular file

l
symbolic link

s
socket

-uid n
File's numeric user ID is n.

-used n
File was last accessed n days after its status was last changed.

-user uname
File is owned by user uname (numeric user ID allowed).

-xtype c
The same as -type unless the file is a symbolic link. For symbolic links: if -follow has not been given, true if the file is a link to a file of type c; if -follow has been given, true if c is `l'. In other words, for symbolic links, -xtype checks the type of the file that -type does not check.

ACTIONS

-exec command ;
Execute command; true if 0 status is returned. All following arguments to find are taken to be arguments to the command until an argument consisting of `;' is encountered. The string `{}' is replaced by the current file name being processed everywhere it occurs in the arguments to the command, not just in arguments where it is alone, as in some versions of find . Both of these constructions might need to be escaped (with a `\') or quoted to protect them from expansion by the shell. The command is executed in the starting directory.

-fls file
True; like -ls but write to file like -fprint.

-fprint file
True; print the full file name into file file. If file does not exist when find is run, it is created; if it does exist, it is truncated. The file names ``/dev/stdout'' and ``/dev/stderr'' are handled specially; they refer to the standard output and standard error output, respectively.

-fprint0 file
True; like -print0 but write to file like -fprint.

-fprintf file format
True; like -printf but write to file like -fprint.

-ok command ;
Like -exec but ask the user first (on the standard input); if the response does not start with `y' or `Y', do not run the command, and return false.

-print
True; print the full file name on the standard output, followed by a newline.

-print0
True; print the full file name on the standard output, followed by a null character. This allows file names that contain newlines to be correctly interpreted by programs that process the find output.

-printf format
True; print format on the standard output, interpreting `\' escapes and `%' directives. Field widths and precisions can be specified as with the `printf' C function. Unlike -print, -printf does not add a newline at the end of the string. The escapes and directives are:

\a
Alarm bell.

\b
Backspace.

\c
Stop printing from this format immediately and flush the output.

\f
Form feed.

\n
Newline.

\r
Carriage return.

\t
Horizontal tab.

\v
Vertical tab.

\\
A literal backslash (`\').

A `\' character followed by any other character is treated as an ordinary character, so they both are printed.

%%
A literal percent sign.

%a
File's last access time in the format returned by the C `ctime' function.

%Ak
File's last access time in the format specified by k, which is either `@' or a directive for the C `strftime' function. The possible values for k are listed below; some of them might not be available on all systems, due to differences in `strftime' between systems.

@
seconds since Jan. 1, 1970, 00:00 GMT.

Time fields:

H
hour (00..23)

I
hour (01..12)

k
hour ( 0..23)

l
hour ( 1..12)

M
minute (00..59)

p
locale's AM or PM

r
time, 12-hour (hh:mm:ss [AP]M)

S
second (00..61)

T
time, 24-hour (hh:mm:ss)

X
locale's time representation (H:M:S)

Z
time zone (e.g., EDT), or nothing if no time zone is determinable

Date fields:

a
locale's abbreviated weekday name (Sun..Sat)

A
locale's full weekday name, variable length (Sunday..Saturday)

b
locale's abbreviated month name (Jan..Dec)

B
locale's full month name, variable length (January..December)

c
locale's date and time (Sat Nov 04 12:02:33 EST 1989)

d
day of month (01..31)

D
date (mm/dd/yy)

h
same as b

j
day of year (001..366)

m
month (01..12)

U
week number of year with Sunday as first day of week (00..53)

w
day of week (0..6)

W
week number of year with Monday as first day of week (00..53)

x
locale's date representation (mm/dd/yy)

y
last two digits of year (00..99)

Y
year (1970...)

%b
File's size in 512-byte blocks (rounded up).

%c
File's last status change time in the format returned by the C `ctime' function.

%Ck
File's last status change time in the format specified by k, which is the same as for %A.

%d
Fájl mélysége a kônyvtár struktúrában; 0 jelentése: a file a paracssor argumentuma volt.

%f
Fájl neve útvonal nélkül; (csak az utolsó elem).

%F
A fájlredszer tipusa, amiben a fájl van; ez az érték használható az -fstype-nál.

%g
Fájl csoportjának neve, vagy csoportazonosító ID, ha nincs a csoprotnak neve.

%G
Fájl csoportazonosító ID-je.

%h
Fájl útvonala.

%H
Parancsssor argumentuma, amely miatt megtalált a fájl.

%i
Fájl i-node száma (decimálisan).

%k
Fájl mérete 1 Kbyte-os blokkokban (felfelé kerekítve).

%l
Fájl, ahova a szimbolikus link mutat (üres sztring, ha a fájl nem szimbolikus link).

%m
Fájl engedély bitjei (oktálisan).

%n
A fájl linkeinek a száma.

%p
Fájl neve.

%P
A törölt fájl neve a parancssor argumentumával, amely miatt megtalált a fájl.

%s
Fájl mérete byte-ban.

%t
Fájl utolsó megváltoztatásának ideje a C `ctime' formátumban.

%Tk
Fájl utolsó változtatásának ideje a k formátumban, amely ugyanaz mint %A.

%u
Fájl tuljadonosának azonosítója, vagy ID száma, ha nincs a tulajdonosnak neve.

%U
Fájl tulajdonosának ID száma.

A `%' karakter utáni bármilyen karakter törölve lesz (de a többi karakter nyomtatva van).

-prune
Ha -depth nincs bekapcsolva, igaz; nem függ az aktuális alkönyvtártól.
Ha -depth bekapcsolva, hamis; nincs következmény.

-ls
Igaz; aktuális fájlok listázása `ls -dils' formátumban a standard kimeneten. A blokkméret 1 Kbyte, hacsak a POSIXLY_CORRECT környezeti változó be van állítva, melyben 512 Byte-os a blokkok mérete.

OPERÁTOROK

Csökkenô precedencia sorredben listázva:

( expr )
Erôsségi sorrend definiálása.

! expr
Igaz ha az expr hamis.

-not expr
Ugyanaz mint ! expr.

expr1 expr2
És ; expr2 nincs kiértékelve ha expr1 hamis.

expr1 -a expr2
Ugyanaz mint expr1 expr2.

expr1 -'s expr2
Ugyanaz mint expr1 expr2.

expr1 -o expr2
Vagy; expr2 nincs kiértékelve ha expr1 igaz.

expr1 -vagy expr2
Ugyanaz mint expr1 -o expr2.

expr1 , expr2
Lista; mindkét expr1 és expr2 kiértékelôdnek. Az expr1 értéke törôdik; a lista értéke a expr2 értéke lesz.

LÁSD MÉG

locate(1L), locatedb(5L), updatedb(1L), xargs(1L) Fájl keresés (azonnal elérhetô Info, vagy nyomtatott)