Skip to content
C.W.K.
Stream
Lesson 06 of 12 · published

Hidden Files and Dotfiles

~10 min · dotfiles, hidden, config

Level 0Window Tourist
0 XP0/95 lessons0/14 achievements
0/100 XP to next level100 XP to go0% complete

The dot is the only thing that hides them

Unix "hidden" files aren't really hidden. They are just files whose name starts with . — and the convention is that ls, GUI file managers, and most tools skip them by default. Type ls -A and there they are.

What lives in your home as dotfiles

  • ~/.zshrc, ~/.zprofile — zsh config
  • ~/.bashrc, ~/.bash_profile — bash config
  • ~/.gitconfig — global git config
  • ~/.ssh/ — SSH keys and config (often chmod 700)
  • ~/.config/ — XDG-style config trees (Starship, fish, nvim, etc.)
  • ~/.local/share/ — XDG data
  • ~/.cache/ — XDG cache (safe to delete)

Why hide config?

Hiding keeps your home directory clean. Imagine running ls in ~ and seeing every tool's settings — fifty entries, most never touched again. Hidden by default keeps the visible space for what you actually work on.

Versioning your dotfiles

Most developers track ~/.zshrc, ~/.gitconfig, etc. in a git repo. Tools like chezmoi or GNU Stow (covered later) handle the symlinking. The first time you set up a fresh Mac, you can git clone + chezmoi apply and your shell feels exactly like home in five minutes.

Hidden is not secure

A leading dot only hides a name from default listings and some graphical views. It does not protect a token or key. Manage permissions, credential storage, and repository ignore rules separately.

A dotfile can be executable code

Shell startup files and editor configuration can run commands when loaded. Read another person's dotfiles before sourcing or installing them, and apply small reversible pieces on a new machine.

Code

Find every dotfile in home·bash
ls -A ~ | head -30
# Just the directories
ls -dA ~/.* 2>/dev/null | head -20
# Their total size
du -sh ~/.* 2>/dev/null | sort -h | tail

External links

Exercise

Run ls -A ~ | wc -l and notice how many hidden files you have. Run du -sh ~/.* 2>/dev/null | sort -h | tail and find the biggest dotdir — for most macs that's ~/.cache, ~/.docker, or ~/.cursor.

Progress

Progress is local-only — sign in to sync across devices.
Spotted a bug or have feedback on this page?Report an Issue

Comments 0

🔔 Reply notifications (sign in)
Sign inPlease sign in to comment.

No comments yet — be the first.