{"id":23184,"date":"2020-12-09T09:57:56","date_gmt":"2020-12-09T01:57:56","guid":{"rendered":"https:\/\/web.mwwsb.com.my\/pjci\/?post_type=kb&#038;p=23184"},"modified":"2022-09-08T20:00:11","modified_gmt":"2022-09-08T12:00:11","slug":"change-permissions-using-find-command-2","status":"publish","type":"kb","link":"https:\/\/www.casbay.com\/guide\/kb\/change-permissions-using-find-command-2","title":{"rendered":"Change permissions using find command"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-post\" data-elementor-id=\"23184\" class=\"elementor elementor-23184\" data-elementor-post-type=\"kb\">\n\t\t\t\t\t\t\t\t\t<section class=\"elementor-section elementor-top-section elementor-element elementor-element-fc243a6 elementor-section-boxed elementor-section-height-default elementor-section-height-default\" data-id=\"fc243a6\" data-element_type=\"section\">\n\t\t\t\t\t\t<div class=\"elementor-container elementor-column-gap-default\">\n\t\t\t\t\t<div class=\"elementor-column elementor-col-100 elementor-top-column elementor-element elementor-element-1b5ffef\" data-id=\"1b5ffef\" data-element_type=\"column\">\n\t\t\t<div class=\"elementor-widget-wrap elementor-element-populated\">\n\t\t\t\t\t\t\t\t<div class=\"elementor-element elementor-element-82b4720 elementor-widget elementor-widget-heading\" data-id=\"82b4720\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-default\">Change permissions using find command<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-17154c3 elementor-widget elementor-widget-text-editor\" data-id=\"17154c3\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>On a Linux server, if you are in need of changing the permissions of a bulk amount of files or directories recursively, we can use the \u2018find\u2019 command to do it. The steps are explained below:<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-4c32c46 elementor-widget elementor-widget-text-editor\" data-id=\"4c32c46\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Step <strong>1<\/strong> of 4<\/p><p>Change to the directory in which you need to change the permissions.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5ff4aa0 elementor-widget elementor-widget-text-editor\" data-id=\"5ff4aa0\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Step <b>2 <\/b>of 4<\/p><p>The permission changes are different based on the situation we are having. If you need to change the permissions of all files inside the directory to 644 recursively, please use the following:\u00a0 find . -type f -exec chmod 644 {} \\;<\/p><p>You can specify a specific directory in the following way as well: find \/home\/abc\/ -type f -exec chmod 644 {} \\;<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-5cbad42 elementor-widget elementor-widget-text-editor\" data-id=\"5cbad42\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Step <b>3 <\/b>of 4<\/p><p>If you are looking to change the permissions of directories inside the current folder to 755, use the following:find \/home\/abc\/ -type d -exec chmod 755 {} \\;<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-d5010e0 elementor-widget elementor-widget-text-editor\" data-id=\"d5010e0\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Step <b>4 <\/b>of 4<\/p><p>If you are looking to change the permissions of all files having 777 permissions only to 644, use the following: find . -type f -perm 777 -exec chmod 644 {} \\;<\/p><p>Use the same format for directories by changing the option f: find . -type d-perm 777 -exec chmod\u00a0755 {} \\;<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-60ffb3e elementor-widget elementor-widget-heading\" data-id=\"60ffb3e\" data-element_type=\"widget\" data-widget_type=\"heading.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t<h2 class=\"elementor-heading-title elementor-size-medium\">The find command<\/h2>\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-fde2d55 elementor-widget elementor-widget-image\" data-id=\"fde2d55\" data-element_type=\"widget\" data-widget_type=\"image.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<img decoding=\"async\" src=\"https:\/\/casbay.com\/guide\/wp-content\/uploads\/2021\/02\/find.jpg\" title=\"\" alt=\"\" loading=\"lazy\" \/>\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-0245b25 elementor-widget elementor-widget-text-editor\" data-id=\"0245b25\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Undeniably, the Linux <strong><em>Find<\/em> Command<\/strong> is one of the most important and frequently used command command-line utility. We often use the command in Unix-like operating systems. <em>Find<\/em> command is used to search and locate the list of files and directories. However, it varies according to the conditions you specify for files that match the arguments.<\/p><p>Besides, <em>find<\/em> can be used in a variety of conditions. For example, you can find files by <strong>permissions<\/strong>,\u00a0<strong>users<\/strong>,\u00a0<strong>groups<\/strong>,\u00a0<strong>file type<\/strong>,\u00a0<strong>date<\/strong>,\u00a0<strong>size<\/strong>, and other possible criteria.<\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<div class=\"elementor-element elementor-element-fe75c28 elementor-widget elementor-widget-text-editor\" data-id=\"fe75c28\" data-element_type=\"widget\" data-widget_type=\"text-editor.default\">\n\t\t\t\t<div class=\"elementor-widget-container\">\n\t\t\t\t\t\t\t<p>Click to read the article- <a href=\"https:\/\/www.casbay.com\/guide\/kb\/file-folder-permission-info\/\">File &amp; Folder Permission [INFO]<\/a><\/p>\t\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t<\/div>\n\t\t\t\t\t\t\t<\/div>\n\t\t<\/section>\n\t\t\t\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Change permissions using find command On a Linux server, if you are in need of changing the permissions of a bulk amount of files or directories recursively, we can use the \u2018find\u2019 command to do it. The steps are explained below: Step 1 of 4 Change to the directory in which you need to change [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"site-sidebar-layout":"no-sidebar","site-content-layout":"page-builder","ast-site-content-layout":"","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"disabled","ast-breadcrumbs-content":"","ast-featured-img":"disabled","footer-sml-layout":"","theme-transparent-header-meta":"default","adv-header-id-meta":"","stick-header-meta":"default","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-gradient":""}}},"kbtopic":[113],"kbtag":[106],"mkb_version":[],"_links":{"self":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/23184"}],"collection":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb"}],"about":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/types\/kb"}],"author":[{"embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/comments?post=23184"}],"version-history":[{"count":5,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/23184\/revisions"}],"predecessor-version":[{"id":35407,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kb\/23184\/revisions\/35407"}],"wp:attachment":[{"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/media?parent=23184"}],"wp:term":[{"taxonomy":"kbtopic","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kbtopic?post=23184"},{"taxonomy":"kbtag","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/kbtag?post=23184"},{"taxonomy":"mkb_version","embeddable":true,"href":"https:\/\/www.casbay.com\/guide\/wp-json\/wp\/v2\/mkb_version?post=23184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}