Linux 的find命令怎么用

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

Linux 的find命令怎么用

批量查找名為hello的文件:

find ./ -name hel*

“*”為模糊匹配

Linux 的find命令怎么用

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

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

例如:find / -name hello.txt

Linux 的find命令怎么用

3、查找刪除名為“hello.txt”文件;

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

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

? 版權聲明
THE END
喜歡就支持一下吧
點贊12 分享