I sometimes work with remote .sh and .htaccess files on web servers and I edit/keep a backup of those on my computer (Windows PC). I recently got an iMac M3 and whenever I download .sh and .htaccess files to my iMac, it seems the Finder hides them automatically.

I know the files are there, because both Terminal and an FTP app list them, however the only one of those two file types that appear when I do CMD+SHIFT+. are the .htaccess files. The .sh files are nowhere to be seen under the Finder, but apps will gladly list them... WTF?

macOS 14.1 Sonoma

  • Can you supply the text or image of the Terminal listing that includes the file, and an image of the Finder window that doesn't? Finder should only hide files starting with a dot; and they should show when All Files Show.
    – benwiggy
    Nov 23, 2023 at 10:00

1 Answer 1


In your Terminal, you can use these commands: (note lower-case 'f' in 'com.apple.finder'

to see the current setting:

defaults read com.apple.finder AppleShowAllFiles

to show .dotfiles, type these two commands:

defaults write com.apple.finder AppleShowAllFiles -bool true
killall Finder

to hide .dotfiles, type these two commands:

defaults write com.apple.finder AppleShowAllFiles -bool false
killall Finder
  • After running the two commands, defaults read com.apple.finder AppleShowAllFiles = 1 but Finder still does not show .sh files. Do I have to reboot the computer?
    – that-ben
    Nov 22, 2023 at 19:23
  • I shut down and restarted the iMac and it's still not showing .sh files (and neither does it show .htaccess files, unless I do CMD+SHIFT+. of course). I don't know what the commands above do, but they don't seem to have changed anything in the Finder.
    – that-ben
    Nov 22, 2023 at 21:26
  • Which OS version? I've been using this for as long as I can remember on macOS/OSX. I just tried again (14.1.1), and it worked, although it didn't seem to take once or twice, but I think that was because I forgot to use the killall Finder command after ... AppleShowAllFiles -bool true . If I have a Finder window open at the time I see it close and then re-open with dotfiles visibility switched. Nov 22, 2023 at 23:17
  • You don't need to use the Terminal and kill the Finder: just use Command Shift period to toggle hidden files.
    – benwiggy
    Nov 23, 2023 at 9:59
  • I don't know why, but this morning, .sh files actually show as normal files! .htaccess ones require a CMD+SHIFT+. but I can live with that. Thanks!
    – that-ben
    Nov 23, 2023 at 12:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .