λ posted @ 2012年9月20日 15:26 in Mixture with tags bash linux tutorial , 21443 阅读


## 只列出常规文件
find ./ -type f

## 只列出文件夹
find ./ -type d

find的man page介绍太长了,眼花缭乱(用zsh的可无视= =;)!百度和GOOGLE的结果也太烂了,几乎全是ls方法。



## 对找到的所有文件进行批处理

find . -type f -exec chmod 644 {} \; # 后面的\;必须的,表示按行输出

find . -type d -exec chmod 755 {} \; # {} 表示找到的文件路径

好了,暂时介绍完毕,大家还是继续man find去吧……

本網站無註明「轉載」的著作均由Jak Wings製作 CC BY-NC-SA 2.5
Creative Commons 保持署名-相同方式分享 2.5

依云 说:
Sep 20, 2012 05:15:12 PM

用 zsh 嘛,输入 find - 然后按 Tab 看看有什么选项,选择 -type 后再按 Tab 看看有那些参数,分别表示什么意思:
>>> find -type
-- file type --
b -- block special file
c -- character special file
d -- directory
f -- normal file
l -- symbolic link
p -- named pipe
s -- socket

λ 说:
Sep 21, 2012 01:16:35 AM

-_-;; 原来zsh这么强大的啊……解释都有……

依云 说:
Sep 21, 2012 09:50:36 AM

是啊,很多时候都不用查手册了 :-)

Blade 说:
Jan 09, 2013 11:57:30 AM

ls -R

find 的强大在于丰富过滤条件,以及找到之后的动作(-exec 参数 以及 管道通向 xargs 等方法)。

λ 说:
Jan 25, 2013 11:58:57 PM


Aug 04, 2022 02:14:16 AM

SSO stands for Single Sign On and SSO Rajasthan for any citizen to create their digital identity. According to their official website, more than 18672702 identities have been create from their official website. There are different benefits of being a part of this online platform out of which the primary one is to be under the Jan Aadhaar scheme and benefits. SSO ID Along with that you can also get benefits from schemes such as Bhamashah but before you do, you have to create your account and in the below guide we have explained the exact steps you need to follow, and if any queries, you may contact SSO customer care.

AP 1st Inter Model P 说:
Aug 25, 2022 07:31:43 PM

Board of Intermediate Education AP (BIEAP) Offer Last Year Important Model Question Paper 2023 for the Following Subjects in Part 1 English, In Part 2 Second Languages ​​Like Telugu, Hindi, Urdu, AP 1st Inter Model Paper 2023 Arabic, French, Tamil, Kannada , Oriya, and Marathi are Provided. In Part 3 Optional Subjects Like Mathematics, Physics, Chemistry, Botany, Zoology, Commerce, Economics, Civics, History, Psychology, Public Administration, Logic, Sociology, Geography, Geology and Modern Language Subjects Like English , Telugu, Hindi, and Urdu are Provided.

登录 *

loading captcha image...
or Ctrl+Enter