In Linux we can use the following command to change permission mode of the files and folders recursively.
find "/Users/Test/Desktop/PATH" -exec * chmod 777 {} \;
how could i do the same for mac as i m getting the following error repeatatively.
find: TEST_FILE: No such file or directory
By using CHMOD yes:
For Recursive file:
For non recursive:
The issue is that the
*
is getting interpreted by your shell and is expanding to a file namedTEST_FILE
that happens to be in your current working directory, so you're tellingfind
to execute the command namedTEST_FILE
which doesn't exist. I'm not sure what you're trying to accomplish with that*
, you should just remove it.Furthermore, you should use the idiom
-exec program '{}' \+
instead of-exec program '{}' \;
so thatfind
doesn't fork a new process for each file. With;
, a new process is forked for each file, whereas with+
, it only forks one process and passes all of the files on a single command line, which for simple programs likechmod
is much more efficient.Lastly,
chmod
can do recursive changes on its own with the-R
flag, so unless you need to search for specific files, just do this:You can just use the -R (recursive) flag.
I do not have a Mac OSx machine to test this on but in bash on Linux I use something like the following to chmod only directories:
but this also does the same thing:
and so does this:
The last two are using different forms of subcommands. The first is using backticks (older and depreciated) and the other the $() subcommand syntax.
So I think in your case that the following will do what you want.
IF they Give Path Directory Error!
In MAC Then Go to Folder Get Info and Open Storage and Permission change to privileges Read To Write