学习find

本文详细介绍了 Linux 下 find 命令的使用方法及其常用选项,包括按时间筛选文件的功能,例如根据访问时间和状态改变时间来查找文件。此外还讲解了如何使用-depth选项实现目录的深度遍历。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

find是linux系统下一个常用的命令。

用户命令:

 

expression      The first argument that starts with a -,  or
                     is  a ! or a (, and all subsequent arguments
                     are interpreted as an expression made up  of
                     the  following  primaries  and operators. In
                     the descriptions, wherever n is  used  as  a
                     primary  argument,  it  is  interpreted as a
                     decimal integer  optionally  preceded  by  a
                     plus (+) or minus (-) sign, as follows:

                     +n       more than n

                     n        exactly n

                     -n       less than n

 

以一个减号(-)、或者(!)或者(()打头的第一个参数和所有后续的参数一起被解析为一个表达式

 

     -atimen         True if the file was accessed  n  days  ago.
                     The  access  time  of directories in path is
                     changed by find itself.

如果文件在n天之前被访问。在path中的目录的访问时间将会被find更新

 

     -ctime n        True if the file's status was changed n days
                     ago.
如果文件在n天之前被修改

 

     -depth          Always true. Causes descent of the directory
                     hierarchy  to be done so that all entries in
                     a directory are acted on before  the  direc-
                     tory  itself.   This can be useful when find
                     is used with cpio(1) to transfer files  that
总是为true。执行深度优先原则。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值