		
		{"id":12361,"date":"2024-07-09T12:23:38","date_gmt":"2024-07-09T12:23:38","guid":{"rendered":"http:\/\/localhost\/netizens_12_aug\/?p=12361"},"modified":"2024-07-09T12:23:38","modified_gmt":"2024-07-09T12:23:38","slug":"linux-find-file","status":"publish","type":"post","link":"https:\/\/netizens.netizens.dev\/br\/blog\/linux-find-file\/","title":{"rendered":"Find Command in Linux: Search Files and Directories Easily"},"content":{"rendered":"<p><span style=\"font-weight: 400;\">The Linux find command is regarded as one of the most effective and comprehensive tools that can be used to find files and directories in the filesystem. Being a system administrator, you need to maintain the servers, or if you are a developer, you have to arrange the files of your project. Then, the find command is one command that you can learn, and this command can save your productivity and help you move through complicated directory structures easily.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">What is the &#8216;find&#8217; Command?<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">The find command refers to a Linux command that is used to search files and folders within a directory. You can find information using such attributes as name, size, type, permissions, or one of the last changed times of the file. Find is able to execute actions on files it finds, unlike simple commands that simply list files; find also enters subfolders and can even execute actions on them.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Basic Syntax of the Find Command<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">The basic syntax of the <\/span><span style=\"font-weight: 400;\">find<\/span><span style=\"font-weight: 400;\"> command follows the pattern below:<\/span><\/p>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Find files using custom path and expression<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> [path] [expression]\n<\/code><\/pre>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>path<\/b><span style=\"font-weight: 400;\">: The starting directory for the search (defaults to the current directory if omitted)<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>expression<\/b><span style=\"font-weight: 400;\">: Criteria for matching files and actions to perform<\/span><\/li>\n<\/ul>\n<h2><span style=\"font-weight: 400;\">How the Find Command Works in Linux<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">The Linux find command is used to scan folders and files on the fly. Find is also an operation that views the current files and folders at the moment, whereas the locate command will use an old database, which may not reflect the recent changes. In such a manner, it is also able to locate files that were recently modified or newly created.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">This is how the process works:<\/span><\/p>\n<ol>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Starting Point<\/b><span style=\"font-weight: 400;\"> \u2013 The command begins from the directory you specify (for example, <\/span><span style=\"font-weight: 400;\">\/home<\/span><span style=\"font-weight: 400;\"> or <\/span><span style=\"font-weight: 400;\">.<\/span><span style=\"font-weight: 400;\"> for the current folder). From this specific point, it starts to explore all files and subdirectories.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Applying Conditions<\/b><span style=\"font-weight: 400;\"> \u2013 You can define rules such as file name, type, size, permissions, or modification time. These rules are compared with every file or folder.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Using Options<\/b><span style=\"font-weight: 400;\"> \u2013With Additional Options. The additional options allow refining the search, such as limiting the depth or not honoring case sensitivity.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>Taking Action<\/b><span style=\"font-weight: 400;\"> \u2013 By default, <\/span><span style=\"font-weight: 400;\">find<\/span><span style=\"font-weight: 400;\"> lists the matching file paths. However, you can also have it do things, e.g., deleting files, moving them, or even running some custom command with -exec.<\/span><\/li>\n<\/ol>\n<p><span style=\"font-weight: 400;\">The find package of the GNU system includes the find command, and it&#8217;s already installed in most Linux distributions, so you can immediately use it.<\/span><\/p>\n<h2><span style=\"font-weight: 400;\">Essential Examples and Use Cases<\/span><\/h2>\n<h3><span style=\"font-weight: 400;\">1. Finding Files by Name<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">The find command can search for files by their names. It enables you to look for an exact file, search with patterns, or ignore upper\/lower case.<\/span><\/p>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Find files with exact name<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/home\/user <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"document.txt\"\n\n<span style=\"color: #999;\"># Find files with pattern matching (case-sensitive)<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.log\"\n\n<span style=\"color: #999;\"># Case-insensitive search<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-iname<\/span> \"*.PDF\"\n<\/code><\/pre>\n<h3><span style=\"font-weight: 400;\">2. Finding Files by Type<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Occasionally, don\u2019t want to search for everything and require a specific file type. The <\/span><span style=\"font-weight: 400;\">-type<\/span><span style=\"font-weight: 400;\"> option in Linux helps with this.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>-type f<\/b><span style=\"font-weight: 400;\"> \u2192 Finds only regular files (like <\/span><span style=\"font-weight: 400;\">.txt<\/span><span style=\"font-weight: 400;\">, <\/span><span style=\"font-weight: 400;\">.log<\/span><span style=\"font-weight: 400;\">, etc.).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>-type d<\/b><span style=\"font-weight: 400;\"> \u2192 Finds only directories (folders).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>-type l<\/b><span style=\"font-weight: 400;\"> \u2192 Finds symbolic links (shortcuts to other files).<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">These are some examples:<\/span><\/p>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Find only regular files<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/var\/log <span style=\"color: #0000cc; font-weight: bold;\">-type<\/span> f\n\n<span style=\"color: #999;\"># Find only directories<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/home <span style=\"color: #0000cc; font-weight: bold;\">-type<\/span> d\n\n<span style=\"color: #999;\"># Find symbolic links<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/usr\/bin <span style=\"color: #0000cc; font-weight: bold;\">-type<\/span> l\n<\/code><\/pre>\n<h3><span style=\"font-weight: 400;\">3. Finding Files by Size<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Sometimes you need to find big files that take up space or tiny files you may have forgotten about. The <\/span><span style=\"font-weight: 400;\">-size<\/span><span style=\"font-weight: 400;\"> option in Linux helps you do that.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>+<\/b><b> (plus)<\/b><span style=\"font-weight: 400;\"> \u2192 larger than the given size<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>&#8211;<\/b><b> (minus)<\/b><span style=\"font-weight: 400;\"> \u2192 smaller than the given size<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">No sign \u2192 exactly that size<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Here are some examples:<\/span><\/p>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Find files larger than 100MB<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/ <span style=\"color: #0000cc; font-weight: bold;\">-size<\/span> +100M\n\n<span style=\"color: #999;\"># Find files smaller than 1KB<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-size<\/span> -1k\n\n<span style=\"color: #999;\"># Find files exactly 50 bytes<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-size<\/span> 50c\n<\/code><\/pre>\n<p><span style=\"font-weight: 400;\">Size units include:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">c<\/span><span style=\"font-weight: 400;\"> for bytes<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">k<\/span><span style=\"font-weight: 400;\"> for kilobytes<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">M<\/span><span style=\"font-weight: 400;\"> for megabytes<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">G<\/span><span style=\"font-weight: 400;\"> for gigabytes<\/span><\/li>\n<\/ul>\n<h3><span style=\"font-weight: 400;\">4. Finding Files by Modification Time<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">If you want to know when files were last updated, the <\/span><span style=\"font-weight: 400;\">-mtime<\/span><span style=\"font-weight: 400;\"> option is very handy. It helps you search by the number of days since a file was changed.<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">-7<\/span><span style=\"font-weight: 400;\"> \u2192 files modified within the last 7 days<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">+30<\/span><span style=\"font-weight: 400;\"> \u2192 files modified more than 30 days ago<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">1<\/span><span style=\"font-weight: 400;\"> \u2192 files modified exactly 1 day ago<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">Here are some examples:<\/span><\/p>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Files modified in the last 7 days<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/home <span style=\"color: #0000cc; font-weight: bold;\">-mtime<\/span> -7\n\n<span style=\"color: #999;\"># Files modified more than 30 days ago<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/tmp <span style=\"color: #0000cc; font-weight: bold;\">-mtime<\/span> +30\n\n<span style=\"color: #999;\"># Files modified exactly 1 day ago<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-mtime<\/span> 1\n<\/code><\/pre>\n<h3><span style=\"font-weight: 400;\">5. Finding Files by Permissions<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">To get a file based on its individual permission settings, you can use the <\/span><span style=\"font-weight: 400;\">-perm<\/span><span style=\"font-weight: 400;\"> option. It&#8217;s most helpful to system admins who need to check which files are readable, writable, or executable.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Examples to show it are:<\/span><\/p>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Find files with exact permissions<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-perm<\/span> 755\n\n<span style=\"color: #999;\"># Find files with at least these permissions<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-perm<\/span> -644\n\n<span style=\"color: #999;\"># Find executable files<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-perm<\/span> \/111\n<\/code><\/pre>\n<h2><span style=\"font-weight: 400;\">Advanced Search Techniques<\/span><\/h2>\n<h3><span style=\"font-weight: 400;\">Combining Multiple Criteria<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">The command also allows for intelligent searching by mixing conditions. You can narrow down or expand your search using AND, OR, and NOT.<\/span><\/p>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Find large log files (AND condition)<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/var\/log <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.log\" <span style=\"color: #0000cc; font-weight: bold;\">-size<\/span> +10M\n\n<span style=\"color: #999;\"># Find files that are either .txt OR .doc (OR condition)<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . \\( <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.txt\" <span style=\"color: #0000cc; font-weight: bold;\">-o<\/span> <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.doc\" \\)\n\n<span style=\"color: #999;\"># Find files that are NOT .tmp files (NOT condition)<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . ! <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.tmp\"\n<\/code><\/pre>\n<p><span style=\"font-weight: 400;\">See these simplified explanations:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>AND<\/b><span style=\"font-weight: 400;\"> \u2192 The two conditions must apply (e.g., file is <\/span><span style=\"font-weight: 400;\">.log<\/span> <b>and<\/b><span style=\"font-weight: 400;\"> bigger than 10MB).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>OR<\/b><span style=\"font-weight: 400;\"> \u2192 Either condition can be valid (e.g., file is <\/span><span style=\"font-weight: 400;\">.txt<\/span> <b>or<\/b> <span style=\"font-weight: 400;\">.doc<\/span><span style=\"font-weight: 400;\">).<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>NOT<\/b><span style=\"font-weight: 400;\"> \u2192 Excludes files (e.g., ignore all <\/span><span style=\"font-weight: 400;\">.tmp<\/span><span style=\"font-weight: 400;\"> files).<\/span><\/li>\n<\/ul>\n<h3><span style=\"font-weight: 400;\">Using Regular Expressions<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">The -regex option allows you to search for files with regular expressions (regex). Regex enables the matching of patterns in filenames. It provides greater flexibility than when using -name.<\/span><\/p>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Find files matching a regex pattern<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-regex<\/span> \".*\\.\\(jpg\\|png\\|gif\\)\"\n\n<span style=\"color: #999;\"># Case-insensitive regex<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-iregex<\/span> \".*\\.jpe?g$\"\n<\/code><\/pre>\n<p><span style=\"font-weight: 400;\">Explanation:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">.*<\/span><span style=\"font-weight: 400;\"> \u2192 Matches any file path.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">\\(jpg\\|png\\|gif\\)<\/span><span style=\"font-weight: 400;\"> \u2192 Means &#8220;jpg OR png OR gif&#8221;.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">-iregex<\/span><span style=\"font-weight: 400;\"> \u2192 Ignores case (so <\/span><span style=\"font-weight: 400;\">.JPG<\/span><span style=\"font-weight: 400;\"> and <\/span><span style=\"font-weight: 400;\">.jpg<\/span><span style=\"font-weight: 400;\"> are both matched).<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">It&#8217;s a worthy command when you:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Required to find <\/span><b>many file types simultaneously<\/b><span style=\"font-weight: 400;\">.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">Need <\/span><b>more control<\/b><span style=\"font-weight: 400;\"> than <\/span><span style=\"font-weight: 400;\">-name<\/span><span style=\"font-weight: 400;\"> can give.<\/span><\/li>\n<\/ul>\n<h3><span style=\"font-weight: 400;\">Limiting Search Depth<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Sometimes admins don\u2019t want their search to go through every folder. The options -maxdepth and -mindepth allow you to control the depth of your search inside directories.\u00a0<\/span><\/p>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Search only in current directory (depth 1)<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-maxdepth<\/span> 1 <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.txt\"\n\n<span style=\"color: #999;\"># Skip the first level and search deeper<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-mindepth<\/span> 2 <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"config\"\n<\/code><\/pre>\n<p><span style=\"font-weight: 400;\">The explanations:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>-maxdepth 1<\/b><span style=\"font-weight: 400;\"> \u2192 Will look only in your current directory.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>-mindepth 2<\/b><span style=\"font-weight: 400;\"> \u2192 Ignores the first level and starts deeper.<\/span><\/li>\n<\/ul>\n<p><span style=\"font-weight: 400;\">This is useful when:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You just want files in the current folder.<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><span style=\"font-weight: 400;\">You don\u2019t want to waste time searching unnecessary subfolders.<\/span><\/li>\n<\/ul>\n<h3><span style=\"font-weight: 400;\">Performing Actions on Found Files<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">The real power of <\/span><span style=\"font-weight: 400;\">find<\/span><span style=\"font-weight: 400;\"> comes from its ability to execute commands on the files it discovers.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Using -exec<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Execute commands on each file found:<\/span><\/p>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Delete all .tmp files<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.tmp\" <span style=\"color: #0000cc; font-weight: bold;\">-exec<\/span> rm {} \\;\n\n<span style=\"color: #999;\"># Change permissions of all .sh files<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.sh\" <span style=\"color: #0000cc; font-weight: bold;\">-exec<\/span> chmod +x {} \\;\n\n<span style=\"color: #999;\"># Copy the .conf files to a backup directory<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/etc <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.conf\" <span style=\"color: #0000cc; font-weight: bold;\">-exec<\/span> cp {} \/backup\/ \\;\n<\/code><\/pre>\n<p><span style=\"font-weight: 400;\">A placeholder <\/span><span style=\"font-weight: 400;\">{}<\/span><span style=\"font-weight: 400;\"> shows individual files found, while \\; terminates the command.<\/span><\/p>\n<h3><span style=\"font-weight: 400;\">Using -exec with Multiple Files<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Processes multiple files at once to improve performance:<\/span><\/p>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Remove multiple files in a single command<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.tmp\" <span style=\"color: #0000cc; font-weight: bold;\">-exec<\/span> rm {} +\n\n<span style=\"color: #999;\"># Move multiple files<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.old\" <span style=\"color: #0000cc; font-weight: bold;\">-exec<\/span> mv {} \/archive\/ +\n<\/code><\/pre>\n<h3><span style=\"font-weight: 400;\">Using -delete<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">The command for promptly deleting files:<\/span><\/p>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Delete empty directories<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-type<\/span> d <span style=\"color: #0000cc; font-weight: bold;\">-empty -delete<\/span>\n\n<span style=\"color: #999;\"># Delete old log files<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/var\/log <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.log\" <span style=\"color: #0000cc; font-weight: bold;\">-mtime<\/span> +30 <span style=\"color: #0000cc; font-weight: bold;\">-delete<\/span>\n<\/code><\/pre>\n<h3><span style=\"font-weight: 400;\">Using -print0 with xargs<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">The handling of filenames containing spaces or special characters occurs through:<\/span><\/p>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Safely process files with spaces in names<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.txt\" <span style=\"color: #0000cc; font-weight: bold;\">-print0<\/span> | <span style=\"color: #0000cc; font-weight: bold;\">xargs<\/span> -0 grep \"search term\"\n\n<span style=\"color: #999;\"># Compress multiple files<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.log\" <span style=\"color: #0000cc; font-weight: bold;\">-print0<\/span> | <span style=\"color: #0000cc; font-weight: bold;\">xargs<\/span> -0 gzip\n<\/code><\/pre>\n<h2><span style=\"font-weight: 400;\">Practical Real-World Examples<\/span><\/h2>\n<h3><span style=\"font-weight: 400;\">System Administration Tasks<\/span><\/h3>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Find and remove core dumps older than 7 days<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/ <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"core.*\" <span style=\"color: #0000cc; font-weight: bold;\">-mtime<\/span> +7 <span style=\"color: #0000cc; font-weight: bold;\">-delete<\/span> 2&gt;\/dev\/null\n\n<span style=\"color: #999;\"># Find world-writable files (security audit)<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/ <span style=\"color: #0000cc; font-weight: bold;\">-perm<\/span> -002 <span style=\"color: #0000cc; font-weight: bold;\">-type<\/span> f 2&gt;\/dev\/null\n\n<span style=\"color: #999;\"># Find SUID files<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/ <span style=\"color: #0000cc; font-weight: bold;\">-perm<\/span> -4000 <span style=\"color: #0000cc; font-weight: bold;\">-type<\/span> f 2&gt;\/dev\/null\n\n<span style=\"color: #999;\"># Clean up temporary files<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/tmp <span style=\"color: #0000cc; font-weight: bold;\">-type<\/span> f <span style=\"color: #0000cc; font-weight: bold;\">-atime<\/span> +7 <span style=\"color: #0000cc; font-weight: bold;\">-delete<\/span>\n<\/code><\/pre>\n<h3><span style=\"font-weight: 400;\">Development and File Management<\/span><\/h3>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Find all Python files and count lines of code<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.py\" <span style=\"color: #0000cc; font-weight: bold;\">-exec<\/span> wc -l {} + | tail -1\n\n<span style=\"color: #999;\"># Find and backup configuration files<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/home <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \".*rc\" <span style=\"color: #0000cc; font-weight: bold;\">-exec<\/span> cp {} \/backup\/configs\/ \\;\n\n<span style=\"color: #999;\"># Find duplicate filenames<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-type<\/span> f <span style=\"color: #0000cc; font-weight: bold;\">-printf<\/span> \"%f\\n\" | sort | uniq -d\n\n<span style=\"color: #999;\"># Find empty files and delete them<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-empty -type<\/span> f <span style=\"color: #0000cc; font-weight: bold;\">-delete<\/span>\n\n<span style=\"color: #999;\"># Find empty directories and delete them<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-empty -type<\/span> d <span style=\"color: #0000cc; font-weight: bold;\">-delete<\/span>\n<\/code><\/pre>\n<h3><span style=\"font-weight: 400;\">Log Analysis and Monitoring<\/span><\/h3>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Find recent error logs<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/var\/log <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.log\" <span style=\"color: #0000cc; font-weight: bold;\">-mtime<\/span> -1 <span style=\"color: #0000cc; font-weight: bold;\">-exec<\/span> grep -l \"ERROR\" {} \\;\n\n<span style=\"color: #999;\"># Find large log files that need rotation<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/var\/log <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.log\" <span style=\"color: #0000cc; font-weight: bold;\">-size<\/span> +100M\n\n<span style=\"color: #999;\"># Monitor configuration changes<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/etc <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.conf\" <span style=\"color: #0000cc; font-weight: bold;\">-mtime<\/span> -1\n<\/code><\/pre>\n<h2><span style=\"font-weight: 400;\">Performance Hacks and Best Practices<\/span><\/h2>\n<h3><span style=\"font-weight: 400;\">1. Optimize Search Paths<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Reduce search time by beginning your search from the most specific directory possible:<\/span><\/p>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Instead of searching from root<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/ <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"httpd.conf\"\n\n<span style=\"color: #999;\"># Search in likely locations<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/etc \/usr\/local\/etc <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"httpd.conf\"\n<\/code><\/pre>\n<h3><span style=\"font-weight: 400;\">2. Use Early Filters<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Take the most restrictive criteria and place them first:<\/span><\/p>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># More efficient: filter by type first<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-type<\/span> f <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.log\" <span style=\"color: #0000cc; font-weight: bold;\">-size<\/span> +10M\n\n<span style=\"color: #999;\"># Less efficient: size check on all entries<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-size<\/span> +10M <span style=\"color: #0000cc; font-weight: bold;\">-type<\/span> f <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.log\"\n<\/code><\/pre>\n<h3><span style=\"font-weight: 400;\">3. Suppress Error Messages<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Stop your output from becoming cluttered by redirecting stderr:<\/span><\/p>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Find all .conf files, suppressing permission errors<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/ <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.conf\" 2&gt;\/dev\/null\n<\/code><\/pre>\n<h3><span style=\"font-weight: 400;\">4. Use Specific File Types<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Specify file types to avoid unnecessary checks:<\/span><\/p>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Only check regular files<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-type<\/span> f <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"pattern\"\n<\/code><\/pre>\n<h2><span style=\"font-weight: 400;\">Common Pitfalls and Troubleshooting<\/span><\/h2>\n<h3><span style=\"font-weight: 400;\">Handling Special Characters<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Cases where filenames possess spaces or special characters:<\/span><\/p>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Use -print0 with xargs -0<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.txt\" <span style=\"color: #0000cc; font-weight: bold;\">-print0<\/span> | <span style=\"color: #0000cc; font-weight: bold;\">xargs<\/span> -0 ls -l\n\n<span style=\"color: #999;\"># Quote the search pattern with spaces<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"file with spaces.txt\"\n<\/code><\/pre>\n<h3><span style=\"font-weight: 400;\">Permission Denied Errors<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Suppress or handle permission errors appropriately:<\/span><\/p>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Suppress all errors<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/ <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.conf\" 2&gt;\/dev\/null\n\n<span style=\"color: #999;\"># Redirect errors to a file for review<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> \/ <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.conf\" 2&gt;errors.log\n<\/code><\/pre>\n<h3><span style=\"font-weight: 400;\">Case Sensitivity<\/span><\/h3>\n<p><span style=\"font-weight: 400;\">Remember that <\/span><span style=\"font-weight: 400;\">-name<\/span><span style=\"font-weight: 400;\"> is case-sensitive while <\/span><span style=\"font-weight: 400;\">-iname<\/span><span style=\"font-weight: 400;\"> is not:<\/span><\/p>\n<pre style=\"background: #f8f8f8; color: #333; padding: 1px 14px 14px 14px; border-radius: 6px; font-size: 18px; line-height: 24px; overflow-x: auto; margin: 10px 0; border: 2px solid #ddd;\"><code>\n<span style=\"color: #999;\"># Only matches .PDF (case-sensitive)<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-name<\/span> \"*.PDF\"\n\n<span style=\"color: #999;\"># Matches .pdf, .PDF, .Pdf, etc. (case-insensitive)<\/span>\n<span style=\"color: #0000cc; font-weight: bold;\">find<\/span> . <span style=\"color: #0000cc; font-weight: bold;\">-iname<\/span> \"*.pdf\"\n<\/code><\/pre>\n<h2><span style=\"font-weight: 400;\">Alternative Tools and When to Use Them<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Although <\/span><span style=\"font-weight: 400;\">find<\/span><span style=\"font-weight: 400;\"> is incredibly useful, sometimes alternative tools prove to be more appropriate for the use:<\/span><\/p>\n<ul>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>locate<\/b><span style=\"font-weight: 400;\">: Faster for simple name searches using a pre-built database<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>grep -r<\/b><span style=\"font-weight: 400;\">: Better for searching file contents<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>fd<\/b><span style=\"font-weight: 400;\">: A modern, faster alternative to find with simpler syntax<\/span><\/li>\n<li style=\"font-weight: 400;\" aria-level=\"1\"><b>tree<\/b><span style=\"font-weight: 400;\">: Better for visualizing directory structures<\/span><\/li>\n<\/ul>\n<h2><span style=\"font-weight: 400;\">Also Read<\/span><\/h2>\n<p><a href=\"https:\/\/netizens.netizens.dev\/br\/blog\/rename-file-linux\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">Rename file linux<\/span><span style=\"font-weight: 400;\"><br \/>\n<\/span><\/a><a href=\"http:\/\/netizenstechnologies.com\/blog\/aws-codewhisperer\/\" target=\"_blank\" rel=\"noopener\"><span style=\"font-weight: 400;\">AWS CodeWhisperer: an AI-powered coding companion<\/span><\/a><\/p>\n<h2><span style=\"font-weight: 400;\">Conclusion<\/span><\/h2>\n<p><span style=\"font-weight: 400;\">Linux find is a tool that cannot be done without by any person dealing with Linux-based systems. From simple file searches to complex system administration, master find and become more efficient and able to manage complex file management situations.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Begin with simple searches and add additional functionality as you grow familiar with it. Always remember to check these commands in a safe environment before executing them on any important systems, particularly when you have to use such options as &#8211; delete or -exec rm.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The trick to finding is to know how to use its multiple options to make specific search terms and then do something significant with the findings. With experience, you will realize that complicated file management operations can be reduced to one-line operations that can save hours of manual effort.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">The find command will be one of your most useful Linux utilities, whether you are cleaning up disk space, auditing system security, dealing with development projects or automating system maintenance.<\/span><\/p>","protected":false},"excerpt":{"rendered":"<p>The Linux find command is regarded as one of the most effective and comprehensive tools that can be used to find files and directories in the filesystem. Being a system administrator, you need to maintain the servers, or if you are a developer, you have to arrange the files of your project. Then, the find [&hellip;]<\/p>","protected":false},"author":2,"featured_media":18640,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[1011],"tags":[2191,2192,2193,2194,2195,2196,2197,2198,2199,2200],"class_list":["post-12361","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-other","tag-linux-find-file","tag-linux-find-file-by-name","tag-linux-find-file-by-name-recursive","tag-linux-find-file-command","tag-linux-find-file-containing-string","tag-linux-find-file-containing-text","tag-linux-find-file-in-directory","tag-linux-find-file-name","tag-linux-find-file-recursively","tag-linux-find-file-with-name"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v23.9 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Use the Find Command in Linux to Search Files<\/title>\n<meta name=\"description\" content=\"Learn how to use the Find command in Linux to quickly search for files and directories. Step-by-step examples for beginners and advanced.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/netizens.netizens.dev\/br\/blog\/linux-find-file\/\" \/>\n<meta property=\"og:locale\" content=\"pt_BR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Use the Find Command in Linux to Search Files\" \/>\n<meta property=\"og:description\" content=\"Learn how to use the Find command in Linux to quickly search for files and directories. Step-by-step examples for beginners and advanced.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/netizens.netizens.dev\/br\/blog\/linux-find-file\/\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-09T12:23:38+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/netizens.netizens.dev\/wp-content\/uploads\/2024\/07\/linux-find-file.png\" \/>\n\t<meta property=\"og:image:width\" content=\"645\" \/>\n\t<meta property=\"og:image:height\" content=\"360\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"admin admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Escrito por\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. tempo de leitura\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/netizens.netizens.dev\/blog\/linux-find-file\/\",\"url\":\"https:\/\/netizens.netizens.dev\/blog\/linux-find-file\/\",\"name\":\"How to Use the Find Command in Linux to Search Files\",\"isPartOf\":{\"@id\":\"https:\/\/netizens.netizens.dev\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/netizens.netizens.dev\/blog\/linux-find-file\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/netizens.netizens.dev\/blog\/linux-find-file\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/netizens.netizens.dev\/wp-content\/uploads\/2024\/07\/linux-find-file.png\",\"datePublished\":\"2024-07-09T12:23:38+00:00\",\"dateModified\":\"2024-07-09T12:23:38+00:00\",\"author\":{\"@id\":\"https:\/\/netizens.netizens.dev\/#\/schema\/person\/5db7227e686a10a4126a2c19b8b70517\"},\"description\":\"Learn how to use the Find command in Linux to quickly search for files and directories. Step-by-step examples for beginners and advanced.\",\"breadcrumb\":{\"@id\":\"https:\/\/netizens.netizens.dev\/blog\/linux-find-file\/#breadcrumb\"},\"inLanguage\":\"pt-BR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/netizens.netizens.dev\/blog\/linux-find-file\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/netizens.netizens.dev\/blog\/linux-find-file\/#primaryimage\",\"url\":\"https:\/\/netizens.netizens.dev\/wp-content\/uploads\/2024\/07\/linux-find-file.png\",\"contentUrl\":\"https:\/\/netizens.netizens.dev\/wp-content\/uploads\/2024\/07\/linux-find-file.png\",\"width\":645,\"height\":360,\"caption\":\"Linux find file\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/netizens.netizens.dev\/blog\/linux-find-file\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/netizens.netizens.dev\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Find Command in Linux: Search Files and Directories Easily\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/netizens.netizens.dev\/#website\",\"url\":\"https:\/\/netizens.netizens.dev\/\",\"name\":\"\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/netizens.netizens.dev\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"pt-BR\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/netizens.netizens.dev\/#\/schema\/person\/5db7227e686a10a4126a2c19b8b70517\",\"name\":\"admin admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"pt-BR\",\"@id\":\"https:\/\/netizens.netizens.dev\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/b0f87bbe7cdbfbd534a40fea7d9d02021e6d3772c3949940e8de2e3df278fb2f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/b0f87bbe7cdbfbd534a40fea7d9d02021e6d3772c3949940e8de2e3df278fb2f?s=96&d=mm&r=g\",\"caption\":\"admin admin\"},\"sameAs\":[\"https:\/\/netizens.netizens.dev\"],\"url\":\"https:\/\/netizens.netizens.dev\/br\/blog\/author\/admin\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Use the Find Command in Linux to Search Files","description":"Learn how to use the Find command in Linux to quickly search for files and directories. Step-by-step examples for beginners and advanced.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/netizens.netizens.dev\/br\/blog\/linux-find-file\/","og_locale":"pt_BR","og_type":"article","og_title":"How to Use the Find Command in Linux to Search Files","og_description":"Learn how to use the Find command in Linux to quickly search for files and directories. Step-by-step examples for beginners and advanced.","og_url":"https:\/\/netizens.netizens.dev\/br\/blog\/linux-find-file\/","article_published_time":"2024-07-09T12:23:38+00:00","og_image":[{"width":645,"height":360,"url":"https:\/\/netizens.netizens.dev\/wp-content\/uploads\/2024\/07\/linux-find-file.png","type":"image\/png"}],"author":"admin admin","twitter_card":"summary_large_image","twitter_misc":{"Escrito por":"admin admin","Est. tempo de leitura":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/netizens.netizens.dev\/blog\/linux-find-file\/","url":"https:\/\/netizens.netizens.dev\/blog\/linux-find-file\/","name":"How to Use the Find Command in Linux to Search Files","isPartOf":{"@id":"https:\/\/netizens.netizens.dev\/#website"},"primaryImageOfPage":{"@id":"https:\/\/netizens.netizens.dev\/blog\/linux-find-file\/#primaryimage"},"image":{"@id":"https:\/\/netizens.netizens.dev\/blog\/linux-find-file\/#primaryimage"},"thumbnailUrl":"https:\/\/netizens.netizens.dev\/wp-content\/uploads\/2024\/07\/linux-find-file.png","datePublished":"2024-07-09T12:23:38+00:00","dateModified":"2024-07-09T12:23:38+00:00","author":{"@id":"https:\/\/netizens.netizens.dev\/#\/schema\/person\/5db7227e686a10a4126a2c19b8b70517"},"description":"Learn how to use the Find command in Linux to quickly search for files and directories. Step-by-step examples for beginners and advanced.","breadcrumb":{"@id":"https:\/\/netizens.netizens.dev\/blog\/linux-find-file\/#breadcrumb"},"inLanguage":"pt-BR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/netizens.netizens.dev\/blog\/linux-find-file\/"]}]},{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/netizens.netizens.dev\/blog\/linux-find-file\/#primaryimage","url":"https:\/\/netizens.netizens.dev\/wp-content\/uploads\/2024\/07\/linux-find-file.png","contentUrl":"https:\/\/netizens.netizens.dev\/wp-content\/uploads\/2024\/07\/linux-find-file.png","width":645,"height":360,"caption":"Linux find file"},{"@type":"BreadcrumbList","@id":"https:\/\/netizens.netizens.dev\/blog\/linux-find-file\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/netizens.netizens.dev\/"},{"@type":"ListItem","position":2,"name":"Find Command in Linux: Search Files and Directories Easily"}]},{"@type":"WebSite","@id":"https:\/\/netizens.netizens.dev\/#website","url":"https:\/\/netizens.netizens.dev\/","name":"","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/netizens.netizens.dev\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"pt-BR"},{"@type":"Person","@id":"https:\/\/netizens.netizens.dev\/#\/schema\/person\/5db7227e686a10a4126a2c19b8b70517","name":"admin admin","image":{"@type":"ImageObject","inLanguage":"pt-BR","@id":"https:\/\/netizens.netizens.dev\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/b0f87bbe7cdbfbd534a40fea7d9d02021e6d3772c3949940e8de2e3df278fb2f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/b0f87bbe7cdbfbd534a40fea7d9d02021e6d3772c3949940e8de2e3df278fb2f?s=96&d=mm&r=g","caption":"admin admin"},"sameAs":["https:\/\/netizens.netizens.dev"],"url":"https:\/\/netizens.netizens.dev\/br\/blog\/author\/admin\/"}]}},"_links":{"self":[{"href":"https:\/\/netizens.netizens.dev\/br\/wp-json\/wp\/v2\/posts\/12361","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/netizens.netizens.dev\/br\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/netizens.netizens.dev\/br\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/netizens.netizens.dev\/br\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/netizens.netizens.dev\/br\/wp-json\/wp\/v2\/comments?post=12361"}],"version-history":[{"count":0,"href":"https:\/\/netizens.netizens.dev\/br\/wp-json\/wp\/v2\/posts\/12361\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/netizens.netizens.dev\/br\/wp-json\/wp\/v2\/media\/18640"}],"wp:attachment":[{"href":"https:\/\/netizens.netizens.dev\/br\/wp-json\/wp\/v2\/media?parent=12361"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/netizens.netizens.dev\/br\/wp-json\/wp\/v2\/categories?post=12361"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/netizens.netizens.dev\/br\/wp-json\/wp\/v2\/tags?post=12361"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}