![]() ![]() For example, to search for all files and directories owned by the user sourcedigit:įind / -user sourcedigit Find and Delete Files Similarly, one can easily serach the files by owner, particular user or group, use the -user and -group options. See the following command where we are searching all files in the /home directory that were modified 30 or more days ago:įind /home/sourcedigit -mtime +30 -daystart Simlarly we can search based on the modification date using the -daystart option. pdf and has been modified in the last five days:įind /home/sourcedigit -name "*.pdf" -mtime 5 See the following example where we will search all files under the /home/sourcedigit directory that ends with. For example, we wiant to find a file which was modified few days ago, but you forgot the name of the file. The most useful aspect of find command it to search for files based on their last modification, access, or change time. tar.gz inside the /home/sourcedigit directory, you would type:įind /home/sourcedigit -type f -name '*.tar.gz' Find Files by Modification Date For example, to find all files ending with. To find files by extension we will use the extension with the command. For example,įind /home/sourcedigit -type f -iname file123.xls Find Files by Extension To execute the command in a case-insensitive search, change the -name option with -iname. Note that the command option name is case sensitive by default. For example, to search for a file named file123.xls in the /home/sourcedigit directory, you would use the following command:įind /home/sourcedigit -type f -name file123.xls To find a file by its name, use the -name option along with the find command. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |