on my MacBook, I booted to RECOVERY TERMINAL.

I get this error “sudo command not found”

critical commands like sudo, brew, su and others are missing from /bin /usr/bin /usr/sbin

i searched with ls -la /usr/bin | grep sudo

Can a bad actor with physical access to my machine delete these from machine? (No Firmware Password Set)

how do I install them back?

When I boot my MacBook with my regular username, sudo and everything else works.

How do I make sure the system recovery software, boot loader and its components are updated.

P.S: I have upgraded to MacOS BigSur

  • 1
    What are you trying to accomplish while booted into Recovery? What the id command return?
    – nohillside
    Commented Nov 13, 2020 at 22:19
  • I have found an article to reconstruct recovery partition of macos. Maybe you can check it out. osxdaily.com/2016/07/03/recreate-recovery-partition-mac. Please respond if it works for you, then I am going to rewrite the guide here as a guide so if anyone else come across the same problem, they can check this thread for their solution.
    – Berk Ilgar
    Commented Nov 13, 2020 at 23:09
  • 3
    When you boot into recovery, you're already running as root so sudo is moot.
    – Allan
    Commented Nov 14, 2020 at 4:48
  • I’m going to explain (hopefully in a kind manner) why you shouldn’t be doing any of this. I would encourage a follow on question if you have a single practical task you seek to do in recovery, but recovery is in no way fit for your proposed use.
    – bmike
    Commented Nov 14, 2020 at 13:09
  • You got answers to the actual problem below already. To add some details: To find the directory sudo is in run type sudo after a normal boot. Also, piping ls isn‘t needed, just run ls /path/to/dir/sudo instead.
    – nohillside
    Commented Nov 14, 2020 at 17:11

3 Answers 3


The modern mac os recovery environment automatically logs in as root. So the su or sudo command is not necessary since you are already using superuser privilages. Try the command ls -lah to see your permessions of the current directory. Or ls -lah whoami to see your user permissions.

  • ls shows access rights on files, not user rights, use id -a for that. And ls whoami will most likely lead to file not found.
    – nohillside
    Commented Nov 14, 2020 at 13:33

This is a very common misunderstanding and an understandably confusing situation.

  1. You are already root user in recovery terminal
  2. Recovery terminal dramatically changes mounted filesystem paths ( be sure / is what you think it is before making changes)
  3. Recovery terminal is a severely restricted shell, many commands are intentionally not available

When you take instructions that were written for a full shell (su and sudo), they will break. This is good since you have none of the protections (guardrails) of a normal shell so the system is designed to only work with fully qualified paths to precisely the limited subset of tools that are available. Brew is designed to not even use sudo except for specific limited setup and maintenance tasks so it uses the normal shell like the normal shell uses recovery shell. You are crossing two intentionally designed abstraction barriers to ask for brew to run in recovery.

Think of recovery terminal as a spare tire. It’s designed to get you to a service station at low speed, not to continue your race or journey. If you get an error in recovery - that error lets you know you need better instructions or to be with a mechanic that can help with your repair. Being skilled about working in a restricted shell is a specialized area and most people don’t need to spend any time learning it. This same advice applies fairly evenly for cron and other restricted tools or environments like containers.

So to answer your question, do not rebuild your entire tool chain in recovery, instead you can use these to restrict and encrypt your data so that someone with physical access can only destroy your data and not modify it.

  • FileVault
  • Firmware passwords
  • Activation Lock

The macOS recovery environment is on a separate, small partition of your startup disk, so /bin, /usr/bin, etc. are not the same folders as on your full installation of macOS. Many commands, including sudo, are not present in the recovery environment* and I'm pretty sure none can be added manually either.

*As others have pointed out, you are automatically logged in as root in the recovery environment so sudo and su are unnecessary.

  • Since I’m unable to use sudo command, (error msg: command not found), how do I fix it or fix the start up disk? sudo was working before Commented Nov 13, 2020 at 22:02
  • 1
    @PersistentCache you didn’t ask that in the question. I would start over with a new thread, just say what you are trying to do - you asked an XY problem question - well done, but the answers here are all correct, but not going to help since you may still be heading down the wrong track
    – bmike
    Commented Nov 14, 2020 at 13:19

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .