Zsh: permission denied on my terminal

Learning Challenge

Moving around directories
Working with files and directories


I was going through the “moving around directories step by step” when I notice few errors I seem to lack permission when I enter certain command and trying to get /var/ after entering “root” directories I keep getting “zsh: permission denied:…”

This is a new skill so I want to experience it fully.I feel like I am on a road block and being denied of experience…or lacking in capabilities…

What I’ve tried

I look up possible solutions still yielded same results…
sudo !! ( to be able to enter my admin password)
chmod +x…

and directions from forums
Catalina terminal needs to have permission to go into ~/Downloads ; ~/Desktop … etc.

You can change this in your : Settings > Security & Privacy > Privacy > Files and Folders.

There you’ll see Terminal : Removable volumes - Network volumes - Downloads folder - Desktop folder.

I even change the log in shell /bin/bash



Hi, @Tristan88! Welcome to the community! :wave:

There’s a lot going on in this screenshot, so let me try to be succinct.

  1. You won’t have permissions to create things in the /var directory. This is referred to as a “System Directory” and it will require you to have the appropriate permissions. You most likely want to stay in your “home” directory. Probably in the Documents or Downloads folders while you’re learning.
  2. A lot of your commands just aren’t commands. For example, / % /var/ is just not even something I can explain. I’m not sure if you’re following a guide somewhere that is having you type this in? Or if you’re just tinkering around?

I’d highly recommend you start at the very beginning of navigating around a Terminal. You want to study commands like ls, cd, touch, mkdir, rm, etc … Once you know how to navigate around folders and view things, these commands that you’re using should hopefully make more sense.

I hope that helps!

Maybe I was overthinking it.

I was following the modules guide and learning’s that we gotten from applying for app academy and there was module about file navigation. I probably did mistyped some commands barely got this computer so I am little clumsy on typing but when I do enter the commands that wasn’t a miss typed it just tell me zsh:denied permission.

I see those commands you listed ill look into it but what bothers me is when I enter certain commands bring me to the zsh:denied permission instead of what output I am seeing our our learning module. Hope this does not become part of our passing assessment because I am stuck on these “denied permission message” and cannot go beyond what the guide/module asking me to do.

If you know the admin password, I’d try changing the sudo password. I had the same issue you are having during the GIT assessment and I thought I was stuck but I did some searching online and it had me change the password and that resolved all my issues. It starts with the “sudo -i” command. See if you can look something up using that command. It’s something to do with being a root user that has superuser privileges or something like that. Anyways, I’m on Windows using the Ubuntu Terminal, so I’m not sure if this will help but it should because we are both still talking about Linux.

That being said, @bryanray is the software engineer and if he thinks you can work with those simple terminal commands to move files and make directories without this issue ever popping up, then maybe see if you are just starting from the home directory in the documents or downloads folder as he said and that should probably stop that from happening (at least for now!!).