Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Show hidden files and folders within Mac terminal

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?

like image 323
FreyGeospatial Avatar asked Dec 06 '25 21:12

FreyGeospatial


1 Answers

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.

macOS doesn't come with the alias (3.). To enable this shortcut:

  1. Create or edit a file ~/.zsh_aliases
  2. Add this line: alias ll='ls -la'
  3. Save the file, then run source ~/.zshrc

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

like image 117
zayadur Avatar answered Dec 08 '25 15:12

zayadur



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!