To perform actions on found files, use the -exec option followed by the command and a pair of curly braces ( \ Files belonging to group ‘developers’: find /path/to/directory -group developers.Files owned by user ‘john’: find /path/to/directory -user john.To search for files based on their owner or group, use the -user or -group option followed by the username or group name. Files modified exactly 14 days ago: find /path/to/directory -mtime 14.Files not modified within the last 30 days: find /path/to/directory -mtime +30.Files modified within the last 7 days: find /path/to/directory -mtime -7.To search for files based on their modification time, use the -mtime option followed by a comparison operator ( +, -, or =) and the number of days. Files exactly 512 bytes: find /path/to/directory -size 512c.Files smaller than 10 KB: find /path/to/directory -size -10k.Files larger than 1 MB: find /path/to/directory -size +1M.To search for files based on their size, use the -size option followed by a comparison operator ( +, -, or =) and the file size. Symbolic links: find /path/to/directory -type l.Directories: find /path/to/directory -type d.Regular files: find /path/to/directory -type f.To search for files based on their type, use the -type option followed by the file type specifier. Using wildcards: find /path/to/directory -name '*.txt'.Case-insensitive search: find /path/to/directory -iname 'filename.txt'.Case-sensitive search: find /path/to/directory -name 'filename.txt'.To search for files by their name or pattern, use the -name option followed by the file name or pattern enclosed in single quotes. -group: Search for files based on their group.-user: Search for files based on their owner.-mtime: Search for files based on their modification time.-size: Search for files based on their size.-type: Search for files based on their type (e.g., regular files, directories, symbolic links).-name: Search for files based on their name or pattern.EXPRESSION: The search criteria, including options and tests.PATH: The directory in which to start the search.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |