#find ./test -name'abc*'! -name'*.php'./test/abc.txt 上面的find命令查找文件名以abc开头同时扩展名不是php的文件。这是一个使用find命令构建强大的搜索表达式的示例 OR操作符 当使用多个名称条件时,find命令将用and操作符组合他们,这意味着只有当文件符合所有条件时才被匹配。然而,如果我们需要执行一个基...
alias rm100m="find / -type f -name *.tar -size +100M -exec rm -i {} \;" # alias rm1g="find / -type f -name *.tar -size +1G -exec rm -i {} \;" # alias rm2g="find / -type f -name *.tar -size +2G -exec rm -i {} \;" # alias rm5g="find / -type f -n...
请运行$ find $HOME -type f -empty or $ find $HOME -type f -size 0类似地,定位所有空目录...
find /home -nogroup 列出/home内不属于本地组的文件或目录 find /home -name tmp.txt -maxdepth 4 列出/home内的tmp.txt 查时深度最多为3层 find /home -name tmp.txt -mindepth 3 从第2层开始查 find /home -empty 查找大小为0的文件或空目录 find /home -size +512k 查大于512k的文件 find ...
Linux系统中,使用man可查询命令手册,如man ls查看ls用法。还有输出重定向、输入重定向等操作,cp用于拷贝文件或文件夹,mv可剪切或重命名,cat等可查看文件内容,还有find、grep等实用命令,以及zip/unzip、tar打包压缩,bc计算,uname获取电脑信息等。
$find . -size 100c -print # 查长度为100c的文件 $find . -size +10 -print #查长度超过期作废10块的文件(1块=512字节) $cd / $find etc home apps -depth -print | cpio -ivcdC65536 -o /dev/rmt0 $find /etc -name "passwd*" -exec grep "cnscn" {} \; #看是否存在cnscn用户 ...
find the sources in DIR [configure dir or `..'] Installation directories: --prefix=PREFIX 在PREFIX中安装与体系结构无关的文件 [/usr/local] --exec-prefix=EPREFIX 在EPREFIX中安装与体系结构相关的文件 [PREFIX] By default, `make install' will install all the files in `/usr/local/bin', `/...
Thepatternis a string of characters that you want to search for in the file names. The locate command will return all file names that contain the pattern as a substring. For example, to find all files that contain the word “yes” in their names, you can use this command:locate yes. ...
1.2、find命令的常用选项及实例 -name 按照文件名查找文件。 find /dir -name filename 在/dir目录及其子目录下面查找名字为filename的文件 find . -name "*.c" 在当前目录及其子目录(用“.”表示)中查找任何扩展名为“c”的文件 -perm 按照文件权限来查找文件。
--check-links 只要不是所有链接都被输出就打印信息 --no-quote-chars=STRING 禁用来自 STRING 的字符引用 --quote-chars=STRING 来自 STRING 的额外的引用字符 --quoting-style=STYLE 设置名称引用风格;有效的 STYLE 值请参阅以下说明 -R, --block-number 每个信息都显示归档内的块数 --show-defaults 显示 ...