First things

Show hidden files

See dotfiles like .env and .gitignore in your file browser and terminal.

  1. Always show hidden files in Finder
    Terminal
    defaults write com.apple.finder AppleShowAllFiles -bool true
    killall Finder

    Or press Cmd + Shift + . in any Finder window to switch them on and off.

  2. List hidden files in the terminal
    Terminal
    ls -la

Check it worked

  1. Check the Finder setting
    Terminal
    defaults read com.apple.finder AppleShowAllFiles

    You should see 1.

Undo it
  1. Hide them again
    Terminal
    defaults write com.apple.finder AppleShowAllFiles -bool false
    killall Finder
  1. List hidden files in the terminal
    Terminal · Ubuntu / Debian
    ls -la

    In the Files app, press Ctrl + H to show or hide them.

  1. Show hidden files and file extensions in File Explorer
    PowerShell
    Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name Hidden -Value 1
    Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name HideFileExt -Value 0
    Stop-Process -Name explorer -Force

    File Explorer restarts by itself in a second or two.

  2. List hidden files in PowerShell
    PowerShell
    Get-ChildItem -Force

Check it worked

  1. Check the setting
    PowerShell
    Get-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name Hidden, HideFileExt

    Hidden should be 1 and HideFileExt should be 0.

Undo it
  1. Hide them again
    PowerShell
    Set-ItemProperty -Path 'HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced' -Name Hidden -Value 2
    Stop-Process -Name explorer -Force