Linux 的find命令怎么用

2023年 9月 22日 82.9k 0

Linux的find命令用法有:1、查找当前路径名字叫“hello.txt”的文件,用法为“find ./ -name 文件名全程”;2、查找根目录名字叫“hello.txt”的文件,用法为“find ./ -name 文件名|xargs rm";3、查找删除名为“hello.txt”文件,用法为“find ./ -name 文件名|xargs rm”。

Linux 的find命令怎么用

详细的了解一下find命令用法及参数吧。

准备条件:

Centos7.9的操作系统的服务器一台;

Xshell终端已经链接了该服务器;

1、查找当前路径名字叫“hello.txt”的文件;

用法:find ./ -name 文件名全程

例如:find ./ -name hello.txt

QQ截图20230922111827.png

批量查找名为hello的文件:

find ./ -name hel*

“*”为模糊匹配

QQ截图20230922111908.png

2、查找根目录名字叫“hello.txt”的文件;

用法:find / -name 文件名全程

例如:find / -name hello.txt

QQ截图20230922111936.png

3、查找删除名为“hello.txt”文件;

用法:find ./ -name 文件名|xargs rm

例如:find ./ -name hello.txt|xargs rm

以上就是Linux 的find命令怎么用的详细内容,更多请关注每日运维网(www.mryunwei.com)其它相关文章!

相关文章

服务器端口转发,带你了解服务器端口转发
服务器开放端口,服务器开放端口的步骤
产品推荐:7月受欢迎AI容器镜像来了,有Qwen系列大模型镜像
如何使用 WinGet 下载 Microsoft Store 应用
百度搜索:蓝易云 – 熟悉ubuntu apt-get命令详解
百度搜索:蓝易云 – 域名解析成功但ping不通解决方案

发布评论