2014-11-05 24 views
0

我正在閱讀find命令的手冊。當我快要落山的選項列表中,我閱讀以下內容..發現中的「初選」是什麼?

初選

All primaries which take a numeric argument allow the number to be preceded 
by a plus sign (``+'') or a minus sign (``-''). A preceding plus 
sign means ``more than n'', a preceding minus sign means ``less than n'' 
and neither means ``exactly n''. 

我有一個很難理解這意味着什麼。我也在試圖找出Google中的「主要」,無法得到很好的答案。

誰能幫我理解這是什麼意思?

+0

看起來像OSX'find'? https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man1/find.1.html添加完整性標籤。 – fedorqui 2014-11-05 15:14:52

+1

閱讀本手冊的頂部,很明顯,「初選」是選項,「操作數」是參數 – 2014-11-05 15:15:27

+0

手冊中有一個「PRIMARIES」部分標題,其後是所有初選的列表: Bmin','-Bnewer'等。 – Barmar 2014-11-05 15:21:20

回答

1

find命令接受兩種參數,它們被find的作者命名爲'primaries'和'operators'。主要參數允許過濾哪些文件要找到find,而操作員是允許組合初選的參數。

在數學中,主要是算術或邏輯表達式的基本組成部分。

還有第三類參數,沒有名稱並且修改了find的目錄層次遍歷行爲,第四類定義了對找到的文件採取什麼操作(打印,刪除等)

的GNU手冊頁使用單詞「測試」而不是「主」

1

從man頁面,這是在OS X中發現初選名單:

-Bmin 
-Bnewer 
-Btime 
-amin 
-anewer 
-atime 
-cmin 
-cnewer 
-ctime 
-d 
-delete 
-depth 
-empty 
-exec 
-execdir 
-flags 
-fstype 
-gid 
-group 
-ignore 
-ilname 
-iname 
-inum 
-ipath 
-iregex 
-iwholename 
-links 
-lname 
-ls 
-maxdepth 
-mindepth 
-mmin 
-mnewer 
-mount 
-mtime 
-name 
-newer 
-newerXY 
-nogroup 
-noignore_readdir_race 
-noleaf 
-nouser 
-ok 
-okdir 
-path 
-perm 
-print 
-print0 
-prune 
-regex 
-samefile 
-size 
-type 
-uid 
-user 
-wholename 
+0

感謝您的迴應。我對Linux很陌生,我試圖很好地感受它是如何工作的。列出的初選是在任何命令上還是在查找命令上工作? – 2014-11-05 15:31:41

+0

每個命令都有自己的選項。這些都是「find」特有的。 – Barmar 2014-11-05 15:36:37

+0

FWIW如果您使用OSX,則不使用Linux。 – tripleee 2014-11-05 15:50:19

1

從開始同一個手冊頁(重點mi ne)爲:

說明

find工具遞歸下降對於列出的每個路徑的目錄樹,評估初選「」和``的操作數「」下面列出的表達式(由``的 )根據樹中的每個文件。

「主要」是用於通過使用find過濾其輸出表達式的基石之一使用的find文檔的術語。