You can make a difference in the Apple Support Community!

When you sign up with your Apple Account, you can provide valuable feedback to other community members by upvoting helpful replies and User Tips.

Looks like no one’s replied in a while. To start the conversation again, simply ask a new question.

In terminal how to list the files and subdirectories in the /Downloads directory

I have a Macbook Pro 2017 model and I am running Big Sur 11.3


I am a user with admin rights.


I can use the ls command in my home directory and some of the other directories like applications or documents . However for some reason why I try to list the /Downloads directory ls does not work.


The files are there, but I cannot use the ls command to list them. See the example from terminal below

I used Sudo su to give me the Super User privileges


sh-3.2# pwd

/Users/simonmansfield

sh-3.2# ls /Downloads

ls: /Downloads: No such file or directory

sh-3.2# ls

.CFUserTextEncoding Dropbox (Old)

.DS_Store Library

.Trash Movies

.bash_history Music

.bash_sessions Parallels

.config Pictures

.cups Public

.dropbox VirtualBox VMs

.lesshst des_keysm

.zoomus keysm

Applications nmaphelp.txt

Applications (Parallels) rfc3766.txt

Desktop rfc3766sm.dec

Documents rfc3766sm.enc

Downloads rfc3766sm.txt

Dropbox

sh-3.2#



MacBook Air 13″, macOS 10.15

Posted on Apr 27, 2021 9:42 PM

Reply
Question marked as Top-ranking reply

Posted on Apr 28, 2021 5:29 AM

You are trying to list a “Downloads” folder located at the top level directory of the Startup volume.

There generally isn’t one there.

There should be one at ~/, meaning your home directory.

ls ~/Downloads

If the current working directory is your home folder, you don’t need the ~/,

ls Downloads.

Similar questions

3 replies

Apr 29, 2021 2:03 PM in response to Barney-15E

Hi Barney


I was working from the default directory that I am in when I launch terminal. I assume that would be my Home directory right ?


When I use the la command from there it shows that there is a Downloads subdirectory off this Home directory. I can CD /Downloads to this subdirectory but I can lis any file there when I use the ls command I receive a "ls: .: Operation not permitted"error


See the cpy of from terminal


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.

Simons-MacBook-Pro:~ simonmansfield$ pwd

/Users/simonmansfield

Simons-MacBook-Pro:~ simonmansfield$ ls

Applications Pictures

Applications (Parallels) Public

Desktop VirtualBox VMs

Documents des_keysm

Downloads keysm

Dropbox nmaphelp.txt

Dropbox (Old) rfc3766.txt

Library rfc3766sm.dec

Movies rfc3766sm.enc

Music rfc3766sm.txt

Parallels

Simons-MacBook-Pro:~ simonmansfield$ cd Downloads

Simons-MacBook-Pro:Downloads simonmansfield$ pwd

/Users/simonmansfield/Downloads

Simons-MacBook-Pro:Downloads simonmansfield$ ls

ls: .: Operation not permitted

Simons-MacBook-Pro:Downloads simonmansfield$ 

In terminal how to list the files and subdirectories in the /Downloads directory

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