Show hidden files and folders within Mac terminal
Asked Answered
K

1

11

I can't believe I can't find a good solution... I have a hidden folder named .venv that I would like to show in my Mac OS Monterey 12.3.1 terminal output.

I've tried:

defaults write com.apple.finder AppleShowAllFiles TRUE
killall Finder

but when I open the terminal in the directory containing .venv and type ls, the hidden folder is not returned. What gives?

Koontz answered 23/4, 2022 at 22:2 Comment(3)
The AppleShowAllFiles controls what you see in Finder, not in Terminal. In Terminal, ls will exclude dot files and ls -a or ls -A will include dot files. You can also add -a as a default option, as shown here.Referendum
But, this is off topic for Stack Overflow and will likely be closed as such.Referendum
This works- thanks! My bad about the wrong forumKoontz
N
23

Have you tried using the -a flag for ls?

  1. To list all files (including hidden files): $ ls -a
  2. To list all files in a list with more details: $ ls -al
  3. Alias (shortcut) for 2. $ ll

ls itself usually ignores entries starting with '.', and the -a or --all flag ignores that protection.

Use ls --help in your terminal to review all available flags.

Norri answered 23/4, 2022 at 22:18 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.