terminal permission denied

my terminal not execute command. shows permission denied. what's the problem

MacBook Pro 13″, macOS 11.0

Posted on Dec 4, 2020 9:29 AM

Reply
Question marked as Top-ranking reply

Posted on Dec 4, 2020 5:25 PM

Usually if you get that error you need to use "sudo" with the command to run the command with administrator privileges. If your user is not an admin account, then you will get this error as well.


You need to be extremely careful running any command with "sudo" as the command line will not protect you from accidental mistakes. Never blindly cut & paste or use commands you find on the Internet as that is a sure fire way to break macOS since many commands need to be customized to your exact situation. You should also understand the commands you are using.


Make sure you have a good backup before attempting to execute any commands in the Terminal app. If users with years of command line experience can accidentally make a fatal mistake and destroy the OS with just a simple typographical error.

5 replies
Question marked as Top-ranking reply

Dec 4, 2020 5:25 PM in response to janezhao779

Usually if you get that error you need to use "sudo" with the command to run the command with administrator privileges. If your user is not an admin account, then you will get this error as well.


You need to be extremely careful running any command with "sudo" as the command line will not protect you from accidental mistakes. Never blindly cut & paste or use commands you find on the Internet as that is a sure fire way to break macOS since many commands need to be customized to your exact situation. You should also understand the commands you are using.


Make sure you have a good backup before attempting to execute any commands in the Terminal app. If users with years of command line experience can accidentally make a fatal mistake and destroy the OS with just a simple typographical error.

Dec 5, 2020 7:38 AM in response to janezhao779

janezhao779 wrote:

I am an admin user . I am just trying to practice on terminal due to a school project . I have no idea what it is going on with this, the information in terminal is as below
The default interactive shell is now zsh.

To update your account to use zsh, please run `chsh -s /bin/zsh`.

For more details, please visit https://support.apple.com/kb/HT208050.

(base) janetekbookpuro:~ janezhao$ 



What exactly is the issue here ...


You can see your current shell, copy & paste:

echo $SHELL


To see your options, copy and paste:

 cat /etc/shells


The default shell has now changed to zsh,

and recommended you change your shell to zsh, the command as given above to do this, copy & paste:

chsh -s /bin/zsh



that's it.


ref:

Open or quit Terminal on Mac - Apple Support


https://support.apple.com/en-gw/guide/terminal/toc


Terminal User Guide for Mac - Apple Support


Dec 4, 2020 8:02 PM in response to Grant Bennet-Alder

I am an admin user . I am just trying to practice on terminal due to a school project . I have no idea what it is going on with this, the information in terminal is as below

The default interactive shell is now zsh.


To update your account to use zsh, please run `chsh -s /bin/zsh`.


For more details, please visit https://support.apple.com/kb/HT208050.


(base) janetekbookpuro:~ janezhao$ 



This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

terminal permission denied

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.