mkdir/cp in Mac terminal gives "Permission denied" error
Solution 1
If you "right-click -> Get info" the Applications folder you will notice that the permissions for the Applications folder are Read/Write for 'system' or 'admin'. For 'everyone' it's Read-only. If you are not an admin you need to use 'sudo cp -R Downloads/___Test /Applications'. Obviously, you need to enter a password.
Solution 2
try
ls -lt
to see access permission of the folder you want copy file into
then use
chmod 777 your_folder_name
to change the access permissions of the folder
Solution 3
MacOS prevents interaction with downloaded files until you confirm that they are safe. You can effectively do this programmatically by running:
xattr -d com.apple.quarantine ~/Downloads/your_file_here
Then you should be able to copy the file.
user1118764
Updated on June 04, 2022Comments
-
user1118764 almost 2 years
I'm trying to copy a directory in terminal from the Downloads directory to a sub-directory within the Applications/ directory, and I keep getting "Permission denied" error. Why is this so?
-
xrisk over 6 yearsPlease don't use
chmod 777
mindlessly, it allows anybody on your computer to read your files! -
shinxg over 6 yearstake it easy man, what we need to do is solve the access problem, if this solution can solve, why not use it.
-
Matthew Read over 5 yearsYou can solve the access problem without introducing another access problem.