2

I want to do the following from the command line:

Terminal Full Disk Access

Is it possible to give the terminal app full disk access from the command line?

I am getting "Operation not permitted" errors when trying to run some commands and believe this is the fix, as Mojave has changed how privacy and security settings work for applications. du -hs | sort - h is the command I am trying to run from the root folder to find out where exactly the disk space is being used, i.e trying to find the folders which take up the largest amount of space. This command gives operation not permitted on certain folders, which I believe can be fixed by giving the terminal app full disk access.

I am sshing into a machine where I cannot use a GUI to change this setting. So can I do it from the terminal?

  • What commands give you this error? – music2myear Jun 13 '19 at 16:02
  • du -hs | sort - h is the command I am trying to run from the root folder to find out where exactly the disk space is being used, i.e trying to find the folders which take up the largest amount of space. This command gives operation not permitted on certain folders, which I believe can be fixed by giving the terminal app full disk access. – Dillon Friel Jun 17 '19 at 8:24
  • Please use the EDIT button to add this information to the body of your question. This will make your original question more clear and help people who might have answers for you. – music2myear Jun 17 '19 at 15:39
1

"Operation Not Permitted" is the response when trying to run any commands on parts of the Operating System protected by System Integrity Protection. To disable System Integrity Protection, you'll need to boot into the recovery partition and type the following into terminal:

csrutil disable

When you reboot the machine you'll be able to access and manipulate any parts of the operating system.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.