-exec: find命令对匹配的文件执行该参数所给出的shell命令。相应命令的形式为'command' { } \;,注意{ }和\;之间的空格。 -ok: 和-exec的作用相同,只不过以一种更为安全的模式来执行该参数所给出的shell命令,在执行每一个命令之前,都会给出提示,让用户来确定是否执行。 #-print 将查找到的文件输出到标准输出 #-exe
find $HOME -mtime 0 Search for files in your home directory which have been modified in the last twenty-four hours. This command works this way because the time since each file was last modified is divided by 24 hours and any remainder is discarded. That means that to match -mtime 0, ...
find path -option [ -print ] [ -exec -ok command ] {} \; #-print 将查找到的文件输出到标准输出 #-exec command {} \; —–将查到的文件执行command操作,{} 和 \;之间有空格,{} 表示find到的结果,最后有反斜杠\ 和 分号 ; 表示命令结束? #-ok 和-exec相同,只不过在操作前要询用户 #find...
find /etc/ -size +3M 查找大于3M的文件,-3M则表示查找小于3兆的文件,单位有M/k/G等(man find,然后输入/-size来查) find /etc/ -size +3M -ls 查找出来后按ls方式显示 3.指定查找的目录深度 find / -maxdepth 5 -name "ifcfg*" 往下找5层 find / -name "ifcfg*" -o -size +3M -o表示或者...
find test -type f -size 0 -exec mv {} /tmp/zerobyte \; The -exec action allows find to perform any shell command on the files it encounters. You will see many more examples of its use later in this article. The curly brackets allow each of the empty files to be moved. ...
To locate all the file that are owned by a particular user in /home directory, run following command, 要找到 /home 目录中属于特定用户的所有文件,请运行以下命令 $ sudo find $HOME -user linuxtechi (16) 找到一个组拥有的所有文件 下面的命令将搜索 apache 组拥有的所有文件。
Reviewed by: Eric Martin Files Search find reference 1. Introduction The Linux find command can be used to find files and directories on a disk. It provides several command-line options that make it a powerful tool. In this tutorial, we’ll look at how to use the find command. 2. ...
The find command has a-sizeswitch to allow users to find files based on their size. Since only files can have a file size, when you use this switch no directories will be listed. To specify the file size, we put a number followed by a letter to represent the unit. You can use the...
-exec: find命令对匹配的文件执行该参数所给出的shell命令。相应命令的形式为‘command’ { } ;,注意{ }和;之间的空格。 -ok: 和-exec的作用相同,只不过以一种更为安全的模式来执行该参数所给出的shell命令,在执行每一个命令之前,都会给出提示,让用户来确定是否执行。
The Linux Find command can filter objects recursively using a simple conditional mechanism, and if you use the -exec flag, you’ll also be able to find a file in Linux straightaway and process it without needing to use another command.