linux的find命令用法有:1、查找當前路徑名字叫“hello.txt”的文件,用法為“find ./ -name 文件名全程”;2、查找根目錄名字叫“hello.txt”的文件,用法為“find ./ -name 文件名|xargs rm”;3、查找刪除名為“hello.txt”文件,用法為“find ./ -name 文件名|xargs rm”。
詳細的了解一下find命令用法及參數吧。
準備條件:
Centos7.9的操作系統的服務器一臺;
Xshell終端已經鏈接了該服務器;
1、查找當前路徑名字叫“hello.txt”的文件;
用法:find ./ -name 文件名全程
例如:find ./ -name hello.txt
批量查找名為hello的文件:
find ./ -name hel*
“*”為模糊匹配
2、查找根目錄名字叫“hello.txt”的文件;
用法:find / -name 文件名全程
例如:find / -name hello.txt
3、查找刪除名為“hello.txt”文件;
用法:find ./ -name 文件名|xargs rm
例如:find ./ -name hello.txt|xargs rm
? 版權聲明
文章版權歸作者所有,未經允許請勿轉載。
THE END