When navigating macOS system folders with spaces in their names—like Group Containers or Application Support—it is common to wrap the entire path in quotes:
ls '~/Library/Group Containers/'
If that command returns nothing or fails to find a folder you know exists, the issue comes down to how your shell handles quotes.
The Cause: Tilde Expansion and Quotes
In zsh (the default macOS shell) and bash, the tilde character (~) is a shortcut that expands to your user home directory (e.g., /Users/yourname).
However, wrapping ~ inside single or double quotes disables tilde expansion. Instead of resolving your home folder, the shell literally looks for a directory named ~ inside your current working directory.
The Fix
To handle spaces in directory names without breaking home directory expansion, use one of these three approaches:
1. Keep the tilde outside the quotes
ls -la ~/'Library/Group Containers/'
2. Use $HOME inside double quotes
Unlike ~, environment variables like $HOME still expand inside double quotes (though not single quotes):
ls -la "\$HOME/Library/Group Containers/"
3. Escape the space with a backslash (no quotes)
ls -la ~/Library/Group\ Containers/
Still Seeing Empty Output or “Operation Not Permitted”?
If you fix the path syntax and macOS still hides the contents or throws a permission error, your terminal app is likely blocked by macOS privacy sandboxing.
To grant access:
- Open System Settings > Privacy & Security > Full Disk Access.
- Toggle on Terminal (or your third-party terminal emulator like iTerm2, Warp, or Ghostty).
- Restart your terminal session and re-run the command.