The find
command can find files or directories based on a given path and expression. It has a lot of parameters, and supports regular expressions. Combining pipeline commands can achieve complex functions.
Syntax format: find [parameter] [path] [find and search scope]
Common parameters:
Example
# 在当前目录下查找文件test.py find . -name test.py # 在当前目录下查找文件test.py,忽略大小写find . -iname test.py # 查找/tmp目录下大于1M的文件find /tmp -size +1M # 查找/home目录下以.jpg结尾的文件,忽略大小写find /home -iname *.jpg
This article is reprinted from https://xugaoxiang.com/2022/06/06/linux-cmds-21-find/
This site is for inclusion only, and the copyright belongs to the original author.