chmod
has a convenient -R
option. If you do chmod -R 775 [dir]
, the files in [dir], the child directories, the files in it, etc. will all be chmod 775
.
It's convenient, but it's inconvenient because I want to have different permissions for directories and files, but all of them are 775, so this is a command to prevent that.
I think there is the number one situation where you need chmod
.
For example, let's say you have a directory situation like this.
If you want the directory to be 775 and the file to be 664, hit this.
775/664.chmod
chmod -R "=r,u+w,g+w,+X" [dir]
** The directory is now 775 and the file is 664 **.
You may not have much chance to do it, but I think that there may be times when you do not have an accident when taking over. Here's how to make it 777/666.
777/666.chmod
chmod -R "=r,u+w,g+w,o+w,+X" [dir]
** The directory is now 777 and the file is 666 **.
It is when you want to make it so-called normal.
755/644.chmod
chmod -R "=r,u+w,+X" [dir]
** The directory is now 755 and the file is 644 **.
The ls
command in the image uses ʻexa.
l -T is an alias for ʻexa -la -T
.
See this article for details on the ʻexacommand that creates colorful
ls`. ..
Use exa rather than ls! Introducing modern Linux commands-Qiita https://qiita.com/navitime_tech/items/c249269a3b47666c784b
Recommended Posts