自拍偷在线精品自拍偷,亚洲欧美中文日韩v在线观看不卡

find 中文man頁(yè)面

系統(tǒng)
這個(gè)文檔是GNU版本find命令的使用手冊(cè)。find搜索目錄樹(shù)上的每一個(gè)文件名,它從左至右鑒定給定的表達(dá)式,按照優(yōu)先規(guī)則(見(jiàn)運(yùn)算符一節(jié))進(jìn)行匹配, 直到知道結(jié)果(運(yùn)算符左邊值為假則進(jìn)行與操作,為真則進(jìn)行或操作),然后find移向下一個(gè)文件名。

find - 在目錄層次中尋找文件

概要

find [path...] [expression]

路徑 表達(dá)式

描述

這個(gè)文檔是GNU版本find命令的使用手冊(cè)。find搜索目錄樹(shù)上的每一個(gè)文件名,它從左至右鑒定給定的表達(dá)式,按照優(yōu)先規(guī)則(見(jiàn)運(yùn)算符一節(jié))進(jìn)行匹配, 直到知道結(jié)果(運(yùn)算符左邊值為假則進(jìn)行與操作,為真則進(jìn)行或操作),然后find移向下一個(gè)文件名。第一個(gè)開(kāi)頭帶有'-','(',')',',',或 '!'這些字符的參數(shù)將是表達(dá)式的開(kāi)始;在它之前的一些參數(shù)是要搜索的路徑,在它之后的一些參數(shù)是測(cè)試類型的表達(dá)式。缺省路徑用當(dāng)前目錄,缺省表達(dá)式用' -print'.假如所有文件都能成功進(jìn)行檢索,find將返回一個(gè) 狀態(tài)值0,有錯(cuò)誤發(fā)生則返回一個(gè)大于0的值。

表達(dá)式

這個(gè)表 達(dá)式是由選項(xiàng)(其總是影響所有的操作,而不僅僅是一個(gè)指定的文件,而且總是返回真值),測(cè)試(其返回一個(gè)真值或一個(gè)假值),和事件()組成,它們都有運(yùn)算 符分開(kāi).-and用在運(yùn)算符忽略的地方.若表達(dá)式?jīng)]有包含事件,這個(gè)表達(dá)式為真值,則 -prune, -print這兩個(gè)事件將用于搜索所有的文件時(shí)缺省使用。

 

選項(xiàng)

所有的選項(xiàng)都能返回真值,它們總能被執(zhí)行,除非放在表達(dá)式中執(zhí)行不到的地方。因此,通常把它們放在表達(dá)式的開(kāi)頭部分。

-daystart

從今天也不從24小時(shí)之前開(kāi)始計(jì)量時(shí)間(對(duì) -amin,-atime, -cmin, -ctime, -mmin, 和-mtime有效)。

-depth

先搜索目錄的內(nèi)容再搜索目錄本身。

-follow

不檢索符號(hào)鏈接。意即 -noleaf。

-help, --help

列出find的命令行用法的概要,然后返回

-maxdepth levels

在命令行下目錄的最大深度級(jí)別(非負(fù)整數(shù)),'-maxdepth 0'意味著只在命令行參數(shù)中應(yīng)用檢測(cè)和事件。

-mindepth levels

小于指定數(shù)字(非負(fù)整數(shù))的深度級(jí)別的目錄層次將不應(yīng)用檢測(cè)和事件。'-mindepth 1'意味著除了當(dāng)前的命令行參數(shù)外將搜索所有的文件。

-mount

在其它文件系統(tǒng)中不進(jìn)入目錄。

-noleaf

不 優(yōu)化假如某一個(gè)目錄里包含少于兩個(gè)以下的子目錄。這個(gè)選項(xiàng)在那些不遵循UNIX文件系統(tǒng)鏈界約定的文件系統(tǒng)中用,像CD-ROM,MS-DOS或AFS卷 加載點(diǎn)上。在UNIX文件系統(tǒng)中,每個(gè)目錄有至少兩個(gè)硬鏈接,它的名字和'.'。它的子目錄(假如有)各自有一個(gè)'..'鏈接到它本身。在FIND檢索一 個(gè)目錄時(shí),在統(tǒng)計(jì)其子目錄少于兩個(gè),意味著將不需要在進(jìn)行下去了。只需要檢索一下這個(gè)目錄名;這在檢索速度上是個(gè)有意義的提高。

-version, --version

顯示FIND的版本號(hào),終止程序。

-xdev 在其它文件系統(tǒng)中不進(jìn)入目錄。

測(cè)試

用下邊的格式可以指定數(shù)字參數(shù)

+n 比n大。

-n 比n小。

n 恰好是n。

-amin n

文件最后一次訪問(wèn)是在n分鐘前。

-anewer file

文件最后訪問(wèn)時(shí)間比指定的file修改時(shí)間更晚。 -anewer會(huì)受到-follow的影響當(dāng)在命令行中-follow在-anewer之前時(shí)。

-atime n

文件最后一次訪問(wèn)是n*24小時(shí)前。

-cmin n

文件的狀態(tài)的改變是在n分鐘前。

-cnewer file

文件狀態(tài)的改變比指定的file狀態(tài)的改變時(shí)間更晚。-cnewer會(huì)受到-follow的影響當(dāng)命令行中-follow在-cnewer之前時(shí)。

-ctime n

文件狀態(tài)的改變時(shí)間是在n*24小時(shí)前。

-empty 文件是空的,它是一個(gè)正規(guī)的文件或目錄。

-false 總是假。

-fstype type

文件是type類型。在不同的unix系統(tǒng)中有多種不同的文件系統(tǒng)類型。在一些不同版本的unix中有效的文件類型有:ufs,4.2, 4.3, nfs, tmp, mfs, S51k, S52k.你可以用-printf加上%F指示來(lái)看你的文件系統(tǒng)的類型。

-gid n 文件的數(shù)字型組ID是n.

-group gname

文件屬于組gname(允許數(shù)字型的gname).

-ilname pattern

同-lname, 但是匹配是大小些不區(qū)分的.

-iname pattern

同-name,但是匹配是大小些不區(qū)分的。舉個(gè)例子,這個(gè)通配符'fo*'和'f??'匹配文件名'Foo', 'FOO', 'foo', 'fOo',等等。

-inum n

文件的i結(jié)點(diǎn)數(shù)是n.

-ipath pattern

同 -path, 但是匹配大小寫不區(qū)分。

-iregex pattern

同 -regex, 但是匹配大小寫不區(qū)分.

-links n

文件有n個(gè)鏈結(jié)。

-lname pattern

文件是個(gè)符號(hào)鏈結(jié)內(nèi)容匹配shell通配符pattern。元字符'/'或'.'不能區(qū)別對(duì)待。

-mmin n

文件的數(shù)據(jù)最后一次被編輯是在n分鐘前.

-mtime n

文件的數(shù)據(jù)最后一次被編輯是在n*24小時(shí)前.

-name pattern

基本的文件名(起始的目錄已經(jīng)檢測(cè)過(guò)了)匹配shell通配符pattern.元字符('*', '?', 和'[]')不能匹配一個(gè)以'.'開(kāi)頭的文件名。忽略在它下邊的目錄或文件,用-prune;參看-path描述中的例子。

-newer file

文件最后編輯時(shí)間比指定的file晚

-newer會(huì)受到-follow的影響當(dāng)在命令行中-follow在-newer之前時(shí)。

-nouser

沒(méi)有用戶符合文件的數(shù)字型用戶ID.

-nogroup

沒(méi)有組符合文件的數(shù)字型組ID.

-path pattern

文 件名匹配shell通配符pattern.元字符不能區(qū)分'/'和'.';因此,像例子find . -path './sr*sc'將列出一個(gè)目錄條目'./src/misc'(假如它存在的話).忽略整個(gè)目錄樹(shù),用-prune比檢測(cè)樹(shù)中的每一個(gè)文件要好一些。舉 個(gè)例子,跳過(guò)'src/emacs'和它下邊的所有文件,列出其它發(fā)現(xiàn)的文件,執(zhí)行下邊的命令: find . -path './src/emacs' -prune -o -print

-perm mode

文件的訪問(wèn)權(quán)限位恰好是mode(八進(jìn)制或符號(hào)).符號(hào)模式用模式0做為開(kāi)始。

-perm -mode

文件的所有訪問(wèn)權(quán)限位mode都設(shè)了。

-perm +mode

文件的一些訪問(wèn)權(quán)限位mode設(shè)了。

-regex pattern

文件匹配規(guī)則的表達(dá)式通配符。這是一個(gè)在整個(gè)路徑中的匹配,而不是一個(gè)檢索。舉個(gè)例子,匹配一個(gè)'./fubar3'文件名的文件,你應(yīng)該用規(guī)則的表達(dá)式'.*bar.'或'.*b.*3',而不是'b.*r3'.

-size n[bckw]

文件占用n個(gè)單元空間。在缺省時(shí)或n后邊跟著字符b時(shí),這個(gè)單元是512字節(jié)的塊,n后邊跟著c是字節(jié),n后邊跟著k是千字節(jié),n后邊跟著w是兩個(gè)字節(jié)的詞.文件大小不能計(jì)算間接的塊,但是能計(jì)算很少的沒(méi)能實(shí)際分配大小的文件。

-true 總是真

-type c

文件是類型c:

b 塊(緩沖)設(shè)備.

c 字符設(shè)備.

d 目錄.

p 有名管道(FIFO).

f 規(guī)則文件.

l 符號(hào)鏈結(jié).

s 插座.

-uid n 文件的數(shù)字型用戶ID是n.

-used n

文件的最后訪問(wèn)時(shí)間是在它的狀態(tài)改變時(shí)間的n天前.

-user uname

文件是屬于名為uname(數(shù)字型ID也可)的用戶。

-xtype c

這一項(xiàng)是和-type相同的除非文件是一個(gè)符號(hào)鏈結(jié)。

若是符號(hào)鏈結(jié):假如 -follow 沒(méi)有給出,若這個(gè)文件鏈結(jié)的是類型為c的文件,則返回真;假如給了-follow選項(xiàng),若c為'l',則返回真.對(duì)于符號(hào)鏈結(jié), -xtype檢測(cè)鏈結(jié)的文件類型,-type不做這樣的檢測(cè)。

 

事件

-exec command ;

執(zhí) 行命令;返回的狀態(tài)值為零則為真。所有在這之后的參數(shù)都是command的參數(shù),直到遇到';'.字符串'{}'將被當(dāng)前的文件名代替,作為當(dāng)前命令的參 數(shù),并不是象一些版本FIND一樣是個(gè)單獨(dú)存在的一個(gè)參數(shù),這些語(yǔ)句應(yīng)該被轉(zhuǎn)義(用'')或被引用,以此來(lái)保護(hù)他們被SHELL展開(kāi)。這個(gè)命令將在起始目 錄被執(zhí)行。

-fls file

值為真;同 -ls 但像 -fprint一樣將輸出寫向文件file

-fprint file

值為真;輸出整個(gè)文件名到文件file中.當(dāng)find運(yùn)行時(shí)file不存在,它將被建立;若存在,原來(lái)的文件內(nèi)容將被刪掉。也可以用名為"/dev/stdout"和"/dev/stderr"的文件,它們分別指的時(shí)是標(biāo)準(zhǔn)輸出和標(biāo)準(zhǔn)錯(cuò)誤。

-fprint0 file

值為真;同 -printf 但是將像 -fprint 一樣將輸出寫像文件file.

-ok command

同 -exec但是先問(wèn)用戶(在標(biāo)準(zhǔn)輸入);假如應(yīng)答不是以'y'或'Y'開(kāi)頭,將不執(zhí)行command,返回假。

-print 值為真;在標(biāo)準(zhǔn)輸出上輸出整個(gè)文件名,并加一個(gè)新行。

-print0

值為真;在標(biāo)準(zhǔn)輸出上輸出整個(gè)文件名,并加一個(gè)空字符。這將允許其它程序能正確的處理在FIND輸出中包含新行的文件名。

-printf format

值為真。通過(guò)解釋轉(zhuǎn)義字符''和指示字符'%',格式化輸出到標(biāo)準(zhǔn)輸出上.空間寬度和精度能像c函數(shù)'printf'一樣被指定。不像 -print, -printf不能在字符串的末尾自動(dòng)加一個(gè)新行。這些轉(zhuǎn)義和指示字符是:

a 鳴聲.

b 退格鍵.

c 馬上停止格式輸出,輸出到標(biāo)準(zhǔn)輸出上。

f 換頁(yè)符.

n 行符.

r 回車符.

t 水平制表符.

v 豎直制表符.

反斜線.

一個(gè)''字符后跟著其它字符將被視為普通字符,它們都將被輸出。

%% 符號(hào)'%'.

%a 在格式輸出中通過(guò)調(diào)用c函數(shù)'ctime'返回文件的最后訪問(wèn)時(shí)間。

%AK 用K指定的格式輸出文件的最后訪問(wèn)時(shí)間。K可以是'@'或者C函數(shù) 'strftime' 函數(shù)的一個(gè)指示。有效的K值列在下邊;它們不一定在所有的系統(tǒng)中都有效,主要取決于這些系統(tǒng)中'strftime'函數(shù)的異同。

@ 從Jan. 1, 1970, 00:00 GMT到現(xiàn)在的秒數(shù)。

時(shí)間域:

H 點(diǎn)鐘 (00..23).

I 點(diǎn)鐘 (01..12).

k 點(diǎn)種 ( 0..23).

l 點(diǎn)鐘 ( 1..12).

M 分鐘 ( 00.59).

p 本地的上午或下午.

r 時(shí)間,12小時(shí)格式 (hh:mm:ss[AP]M).

S 秒鐘 (00.61).

T 時(shí)間,24小時(shí)格式 (hh:mm:ss).

X 本地的時(shí)間表示 (H:M:S).

Z 時(shí)區(qū) (舉例來(lái)說(shuō),EDT(美國(guó)東部時(shí)區(qū))),或沒(méi)有表示沒(méi)有可決定的時(shí)區(qū)。

日期域:

a 本地縮寫的星期名 (Sun..Sat).

A 本地完全的星期名,不定長(zhǎng) (Sunday..Saturday).

b 本地縮寫的月份名 (Jan...Dec).

B 本地完全的月份名,不定長(zhǎng) (January...December).

c 本地的日期和時(shí)間 (Sat Nov 04 12:02:33 EST 1989).

d 當(dāng)月的哪一天 (01..31).

D 日期 (mm/dd/yy).

h 同 b.

j 當(dāng)年的哪一天 (001..366).

m 月份 (01..12).

U 當(dāng)年的星期數(shù),用星期日做為一星期的第一天 (00..53).

w 星期的哪一天

W 當(dāng)年的星期數(shù),用星期一做為一星期的第一天 (00..53).

 

x 本地的日期表示法 (mm/dd/yy).

y 當(dāng)年的最后兩位數(shù) (00..99).

Y 年份 (1970...).

%b 用512字節(jié)的塊計(jì)算的文件的大小(上舍入)。

%c 用C函數(shù)'ctime'返回的文件狀態(tài)的最后改變時(shí)間。

%Ck 被k指定的文件狀態(tài)的最后改變時(shí)間,k與%A后的k相同.

%d 文件在目錄樹(shù)中的深度;0意味著文件在命令行參數(shù)中.

%f 不帶目錄的文件名(只有最后的元素).

%F 這個(gè)文件所在的文件系統(tǒng)類型名;這個(gè)值能被 -fstype用。

%g 文件的組名,若組無(wú)名則是組ID.

%G 文件的數(shù)字組ID.

%h 文件的主目錄 (除了最后的元素).

%H 命令行參數(shù)若文件在命令行參數(shù)中找到.

%i 文件的i節(jié)點(diǎn)數(shù) (10進(jìn)制格式).

%k 用1K字節(jié)的塊計(jì)算文件的大小(上舍入)。

%l 符號(hào)鏈接的目標(biāo)(假如文件不是一個(gè)符號(hào)鏈接則返回一個(gè)空字符串).

%m 文件的訪問(wèn)權(quán)限位 (八進(jìn)制)

%n 文件的硬鏈接數(shù)

%p 文件名.

%P 用在命令行參數(shù)之下發(fā)現(xiàn)的文件名代替文件名.

%s 用字節(jié)計(jì)算的文件大小.

%t 用C函數(shù)'ctime'返回的文件的最后編輯時(shí)間。

%Tk 被k指定格式的文件的最后編輯時(shí)間,k與%A后的k相同.

%u 文件的用戶名,若沒(méi)有則輸出用戶數(shù)字ID. 

%U 文件的數(shù)字ID. 

字符'%'后跟著另外的字符將被丟棄(但是其它的字符將輸出).

-prune 假如 -depth 沒(méi)指定,值為真;不進(jìn)入當(dāng)前的目錄。

若 -depth 給定,值為假;沒(méi)作用.

-ls 值為真;用 'ls -dils'格式在標(biāo)準(zhǔn)輸出中列出當(dāng)前目錄的文件。

塊記數(shù)單位是1k字節(jié),除非 設(shè)定了POSIXLY_CORRECT環(huán)境變量,將用512字節(jié)作為單位。

操作符

列出優(yōu)先級(jí)順序

 

( expr )

強(qiáng)制優(yōu)先.

! expr 假如expr為假則為真.

-not expr

同 ! expr.

expr1 expr2

和操作(默認(rèn)); 假如expr1值是假expr2不能鑒定。

expr1 -a expr2

同 expr1 expr2.

expr1 -o expr2

與操作;假如expr1值是真expr2不能鑒定。

expr1 -or expr2

同 expr1 -o expr2.

expr1, expr2

序列;expr1,expr2都能被執(zhí)行,expr1的值舍棄;

序列的值是expr2的值。

參見(jiàn)

locate(1L), locatedb(5L), updatedb(1L), xargs(1L) 

#p#

NAME

find - search for files in a directory hierarchy  

SYNOPSIS

find [path...] [expression]  

DESCRIPTION

This manual page documents the GNU version of findfind searches the directory tree rooted at each given file name by evaluating the given expression from left to right, according to the rules of precedence (see section OPERATORS), until the outcome is known (the left hand side is false for and operations, true for or), at which point find moves on to the next file name.

The first argument that begins with `-', `(', `)', `,', or `!' is taken to be the beginning of the expression; any arguments before it are paths to search, and any arguments after it are the rest of the expression. If no paths are given, the current directory is used. If no expression is given, the expression `-print' is used.

find exits with status 0 if all files are processed successfully, greater than 0 if errors occur.  

EXPRESSIONS

The expression is made up of options (which affect overall operation rather than the processing of a specific file, and always return true), tests (which return a true or false value), and actions (which have side effects and return a true or false value), all separated by operators. -and is assumed where the operator is omitted. If the expression contains no actions other than -prune, -print is performed on all files for which the expression is true.  

OPTIONS

All options always return true. They always take effect, rather than being processed only when their place in the expression is reached. Therefore, for clarity, it is best to place them at the beginning of the expression.
-daystart
Measure times (for -amin, -atime, -cmin, -ctime, -mmin, and -mtime) from the beginning of today rather than from 24 hours ago.
-depth
Process each directory's contents before the directory itself.
-follow
Dereference symbolic links. Implies -noleaf.
-help, --help
Print a summary of the command-line usage of find and exit.
-maxdepth levels
Descend at most levels (a non-negative integer) levels of directories below the command line arguments. `-maxdepth 0' means only apply the tests and actions to the command line arguments.
-mindepth levels
Do not apply any tests or actions at levels less than levels (a non-negative integer). `-mindepth 1' means process all files except the command line arguments.
-mount
Don't descend directories on other filesystems. An alternate name for -xdev, for compatibility with some other versions offind.
-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 pattern
Like -name, but the match is case insensitive. For example, the patterns `fo*' and `F??' match the file names `Foo', `FOO', `foo', `fOo', etc.
-inum n
File has inode number n.
-ipath pattern
Like -path, but the match is case insensitive.
-iregex pattern
Like -regex, but the match is case insensitive.
-links n
File has n links.
-lname pattern
File is a symbolic link whose contents match shell pattern pattern. The metacharacters do not treat `/' or `.' specially.
-mmin n
File's data was last modified n minutes ago.
-mtime n
File's data was last modified n*24 hours ago.
-name pattern
Base of file name (the path with the leading directories removed) matches shell pattern pattern. The metacharacters (`*', `?', and `[]') do not match a `.' at the start of the base name. To ignore a directory and the files under it, use -prune; see an example in the description of -path.
-newer file
File was modified more recently than file. -newer is affected by -follow only if -follow comes before -newer on the command line.
-nouser
No user corresponds to file's numeric user ID.
-nogroup
No group corresponds to file's numeric group ID.
-path pattern
File name matches shell pattern pattern. The metacharacters do not treat `/' or `.' specially; so, for example, 
find . -path './sr*sc' 
will print an entry for a directory called './src/misc' (if one exists). To ignore a whole directory tree, use -prune rather than checking every file in the tree. For example, to skip the directory `src/emacs' and all files and directories under it, and print the names of the other files found, do something like this: 
find . -path './src/emacs' -prune -o -print 
-perm mode
File's permission bits are exactly mode (octal or symbolic). Symbolic modes use mode 0 as a point of departure.
-perm -mode
All of the permission bits mode are set for the file.
-perm +mode
Any of the permission bits mode are set for the file.
-regex pattern
File name matches regular expression pattern. This is a match on the whole path, not a search. For example, to match a file named `./fubar3', you can use the regular expression `.*bar.' or `.*b.*3', but not `b.*r3'.
-size n[cwbkMG]
File uses n units of space. The following suffixes can be used:
`b'
for 512-byte blocks (this is the default if no suffix is used)
`c'
for bytes
`w'
for two-byte words
`k'
for Kilobytes (units of 1024 bytes)
`M'
for Megabytes (units of 1048576 bytes)
`G'
for Gigabytes (units of 1073741824 bytes)
The size does not count indirect blocks, but it does count blocks in sparse files that are not actually allocated. Bear in mind that the `%k' and `%b' format specifiers of -printf handle sparse files differently. The `b' suffix always denotes 512-byte blocks and never 1 Kilobyte blocks, which is different to the behaviour of -ls.
-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
D
door (Solaris)
-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.
-context scontext
--context scontext
(SELinux only) File has the security context scontext.
 

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 offind. 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 (`\').
\NNN
The character whose ASCII code is NNN (octal).

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
File's depth in the directory tree; 0 means the file is a command line argument.
%f
File's name with any leading directories removed (only the last element).
%F
Type of the filesystem the file is on; this value can be used for -fstype.
%g
File's group name, or numeric group ID if the group has no name.
%G
File's numeric group ID.
%h
Leading directories of file's name (all but the last element).
%H
Command line argument under which file was found.
%i
File's inode number (in decimal).
%k
File's size in 1K blocks (rounded up).
%l
Object of symbolic link (empty string if file is not a symbolic link).
%m
File's permission bits (in octal).
%n
Number of hard links to file.
%p
File's name.
%P
File's name with the name of the command line argument under which it was found removed.
%s
File's size in bytes.
%t
File's last modification time in the format returned by the C `ctime' function.
%Tk
File's last modification time in the format specified by k, which is the same as for %A.
%u
File's user name, or numeric user ID if the user has no name.
%U
File's numeric user ID.
%Z
(SELinux only) file's security context.

A `%' character followed by any other character is discarded (but the other character is printed).

-prune
If -depth is not given, true; do not descend the current directory. 
If -depth is given, false; no effect.
-ls
True; list current file in `ls -dils' format on standard output. The block counts are of 1K blocks, unless the environment variable POSIXLY_CORRECT is set, in which case 512-byte blocks are used.
 

OPERATORS

Listed in order of decreasing precedence:
expr )
Force precedence.
expr
True if expr is false.
-not expr
Same as ! expr.
expr1 expr2
And (implied); expr2 is not evaluated if expr1 is false.
expr1 -a expr2
Same as expr1 expr2.
expr1 -and expr2
Same as expr1 expr2.
expr1 -o expr2
Or; expr2 is not evaluated if expr1 is true.
expr1 -or expr2
Same as expr1 -o expr2.
expr1 , expr2
List; both expr1 and expr2 are always evaluated. The value of expr1 is discarded; the value of the list is the value of expr2.
 

SEE ALSO

locate(1L), locatedb(5L), updatedb(1L), xargs(1L) Finding Files (on-line in Info, or printed)

責(zé)任編輯:yangsai 來(lái)源: cmpp
相關(guān)推薦

2011-08-15 10:21:09

man中文man

2011-08-24 16:48:36

man中文man

2011-08-11 16:11:49

at中文man

2011-08-25 10:21:56

man.conf中文man

2011-08-25 16:44:46

ftrylockfil中文man

2011-08-25 16:06:20

fgetc中文man

2011-08-12 11:07:19

git中文man

2011-08-12 13:05:13

vim中文man

2011-08-12 13:18:19

head中文man

2011-08-12 14:16:52

intro中文man

2011-08-12 14:53:56

kill中文man

2011-08-25 11:36:08

ttytype中文man

2011-08-25 11:44:36

wtmp中文man

2011-08-25 14:03:36

creat中文man

2011-08-25 14:28:33

send中文man

2011-08-25 14:33:48

sendto中文man

2011-08-25 14:46:57

bindtextdom中文man

2011-08-25 13:51:48

accept中文man

2011-08-25 14:53:29

bzero中文man

2011-08-25 14:56:04

cfgetospeed中文man
點(diǎn)贊
收藏

51CTO技術(shù)棧公眾號(hào)