{"id":9016,"date":"2026-05-30T14:27:56","date_gmt":"2026-05-30T12:27:56","guid":{"rendered":"https:\/\/mybox.com\/help\/?post_type=manual_kb&#038;p=9016"},"modified":"2026-05-30T14:27:57","modified_gmt":"2026-05-30T12:27:57","slug":"ssh-command-find","status":"publish","type":"manual_kb","link":"https:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-command-find\/","title":{"rendered":"SSH command &#8211; find"},"content":{"rendered":"\n<div class=\"translation-block translation-block-merged\">\n<p class=\"wp-block-paragraph\">The <code>find<\/code> command is used to search for files and directories on a Linux system through SSH. It allows you to locate items based on different criteria such as name, type, or size.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">It is commonly used when managing website files on a server where manual navigation through directories would be inefficient.<\/p>\n\n\n\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_86 ez-toc-wrap-left counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-command-find\/#How_the_command_works\" >How the command works<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-command-find\/#Searching_by_name\" >Searching by name<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-command-find\/#Searching_by_type\" >Searching by type<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-command-find\/#Searching_by_size\" >Searching by size<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-command-find\/#Executing_actions_on_found_files\" >Executing actions on found files<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-command-find\/#Practical_considerations\" >Practical considerations<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/mybox.com\/help\/en\/knowledgebase\/ssh-command-find\/#Before_you_begin\" >Before you begin<\/a><\/li><\/ul><\/nav><\/div>\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"How_the_command_works\"><\/span>How the command works<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<\/div>\n\n<div id=\"mybox-1457671164\" class=\"mybox-content mybox-entity-placement\"><div class=\"early-access-banner-inpost\">\r\n  <div class=\"banner-left-inpost\">\r\n    <div class=\"icon-box-inpost\">\r\n      <img decoding=\"async\" src=\"https:\/\/mybox.com\/help\/wp-content\/uploads\/2026\/02\/square-info-icon.svg\" alt=\"Info\">\r\n    <\/div>\r\n    <div class=\"text-box-inpost\">\r\n      <span class=\"label-inpost\"><span class=\"translation-block translation-block-banner-text\">Early access<\/span><\/span>\r\n      <h4><span class=\"translation-block translation-block-banner-text\">Still need help?<\/span><\/h4>\r\n      <p><span class=\"translation-block translation-block-banner-text\">Contact our customer service team.<\/span><\/p>\r\n    <\/div>\r\n  <\/div>\r\n\r\n  <div class=\"banner-right-inpost\">\r\n    <a href=\"https:\/\/panel.mybox.com\/helpdesk2\/v\/list\/\" class=\"banner-button-inpost\"><span class=\"translation-block translation-block-banner-text\">Message us<\/span><\/a>\r\n  <\/div>\r\n<\/div><\/div>\n\n<div class=\"translation-block translation-block-merged\"><p class=\"wp-block-paragraph\">The basic structure of the command is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find &#91;directory] &#91;options]\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The command searches through the specified directory and its subdirectories, returning results that match the defined conditions.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Searching_by_name\"><\/span>Searching by name<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">To find a file with a specific name:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find \/ -name \"filename.txt\"\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This searches the entire system (<code>\/<\/code>) for a file named <code>filename.txt<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you want to search within a specific directory, replace <code>\/<\/code> with the relevant path.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Searching_by_type\"><\/span>Searching by type<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can limit results to files or directories only.<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find \/ -type f   # files only\nfind \/ -type d   # directories only\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Searching_by_size\"><\/span>Searching by size<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The <code>find<\/code> command can also filter results based on file size:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find \/ -size +2M   # files larger than 2 MB\nfind \/ -size -2M   # files smaller than 2 MB\n<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Executing_actions_on_found_files\"><\/span>Executing actions on found files<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You can run additional commands on each result returned by <code>find<\/code>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, changing file permissions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>find \/ -name \"file.txt\" -exec chmod 0755 {} \\;\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">In this case:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>{}<\/code> represents each file found<\/li>\n\n\n\n<li><code>\\;<\/code> marks the end of the command<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Practical_considerations\"><\/span>Practical considerations<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">When using <code>find<\/code>, especially with the root directory (<code>\/<\/code>), the search can take time because the system scans many folders.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To improve performance, it is recommended to narrow the search path whenever possible.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Be careful when using <code>-exec<\/code>, as it applies the action to every matching file.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\"><span class=\"ez-toc-section\" id=\"Before_you_begin\"><\/span>Before you begin<span class=\"ez-toc-section-end\"><\/span><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">You need SSH access enabled in your hosting account to use command-line tools.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If SSH access is not yet active, you can enable it from the <strong>mybox panel<\/strong> in the account settings.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"template":"","format":"standard","manualknowledgebasecat":[54],"manual_kb_tag":[1531,4886,6161,6162,6163,6164,6165,6166,6167,6168],"class_list":["post-9016","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-ssh","manual_kb_tag-search-files","manual_kb_tag-find-command","manual_kb_tag-file-search","manual_kb_tag-linux-find","manual_kb_tag-find-usage","manual_kb_tag-search-directories","manual_kb_tag-directory-search","manual_kb_tag-find-by-name","manual_kb_tag-search-by-name","manual_kb_tag-find-by-type"],"_links":{"self":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/9016","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/users\/1"}],"version-history":[{"count":1,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/9016\/revisions"}],"predecessor-version":[{"id":9017,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb\/9016\/revisions\/9017"}],"wp:attachment":[{"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/media?parent=9016"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manualknowledgebasecat?post=9016"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/mybox.com\/help\/en\/wp-json\/wp\/v2\/manual_kb_tag?post=9016"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}