MacOS – Access user folders via Terminal

command linemacospermissionSecurityterminal

When I am using Terminal to go to different folders such as Documents, Downloads, Photos etc I get presented with a dialog requesting me to grant Terminal access to these folders such as below:

enter image description here

Is there anyway to bypass this by using Sudo rights in Terminal such as:

$ sudo cd ~/Downloads

Unfortunately doing the above still shows the dialog when I was expecting the password to be enough. Is there any way to grant permission via terminal?

My OS is Catalina

Best Answer

Yes. Open up security preferences.

Add Terminal app to full disk access, same as described for the systemsetup command.