0

(EDITED for specificity)

When I use terminal in recovery mode (on a MacBook Pro with Apple silicon) a lot of bash commands seem to be missing and give me "command not found" errors when I try to run them. This goes for less basic commands like systemsetup that problem aren't standard bash, but also some really core ones like sudo and man and du (but not df). What causes this? I looked up another question (sudo: command not found) that suggested maybe there was an issue with my PATH, but the steps that were suggested to fix it didn't change anything:

-bash-3.2# /usr/bin/nano ~/.bash_profile
-bash: /usr/bin/nano: No such file or directory
-bash-3.2# /bin/cat /etc/paths
cat: /etc/paths: No such file or directory
-bash-3.2# export PATH="/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"
-bash-3.2# sudo echo test
-bash: sudo: command not found

Is recovery mode running a super stripped down bash that doesn't recognize these commands? Or does this have to do with the way my system was damaged somehow? Or something else?

9
  • 2
    You are already running as root, so no sudo is required. BUT: Did you boot into recovery mode?
    – nohillside
    May 15, 2023 at 17:30
  • @nohillside Yes, I booted into recovery mode May 15, 2023 at 17:39
  • 1
    When you’re in Recovery, you should be able to SSH right into the the machine. You need to use the IP address instead as all of the sshd.config settings including SSh keys will be different as this is a different OS than the installed one.
    – Allan
    May 15, 2023 at 17:43
  • @Allan how can I find the IP address for the machine? May 15, 2023 at 17:45
  • ifconfig en0 or ifconfig en1. Whatever the device name for your network connection
    – Allan
    May 15, 2023 at 17:54

1 Answer 1

2

As already mentioned, you're running as root so sudo is not needed.

However, to elaborate more, you're not booting from your regular system - many tools will not be available. There is nothing wrong with your system. It is stripped down to the bare minimum to allow you to interact with your disk and diagnose problems.

1
  • So is there any way to get access to a tool like du? May 24, 2023 at 15:07

You must log in to answer this question.

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