10

ルート ディレクトリにいくつかのサブディレクトリがあります。一度chmod 777にそれらのディレクトリに許可を与えたいです。

個別に許可できることはわかってchmod -r 777 abcdいますが、一度に必要なディレクトリに許可を与えたいです。

例 :

XYZ -- Parent Directory 

ABCD EGF GHY JHF OIEDF -- These are sub directories.

now i want to give chmod 777 to ABCD EGF GHY . at a time to all these directories.

前もって感謝します。

4

2 に答える 2

14

Assuming XYZ is the path to the root of your files, you can use globbing to exactly match the files you want:

chmod 777 /XYZ/{ABCD,EGF,GHY}

Then you can use the -R flag to do it recursively on all files and folders contained in these folders.

chmod -R 777 /XYZ/{ABCD,EGF,GHY}

To apply a non-recursive chmod on the 3 folder plus the parent, you can use:

chmod 777 /XYZ/{ABCD,EGF,GHY,}

Note the last comma, to include the directory itself in the globbing

于 2013-09-30T12:06:52.170 に答える