website/content/blog/making_dotfiles_visible_on_mac.md

26 lines
1.4 KiB
Markdown
Raw Normal View History

2023-09-05 14:15:29 +02:00
---
title: 'Making dotFiles visible on the Mac'
date: 2011-07-20T20:56:00.000Z
draft: false
taxonomies:
tags: [ "mac" ]
categories: [ "os", "apps" ]
2023-09-05 14:15:29 +02:00
---
Dotfiles, can't live with 'em, can't live without 'em. Dot files are the term for folders and files starting with a '.' so they do not show upwhen using plain **ls**. Tha Mac has a cool keycode to toggle visibility of dotfiles in the **File Open/Save** dialog, but this does not work in the finder for one reason or another. In practice this meant I had to deal with dotFiles and dotDriectories I found on the net some incantation to force the setting for the finder to show/hide the dotfiles. Upon restarting the finder the widows will reopen with the updated setting. I found on the net some snippets of sh script (but I forgot where and cannot immediately retrieve it), and I immediately dumped them in my **~/bin** folder. ~/bin/hide-dotfiles :
#!/bin/sh
defaults write com.apple.finder AppleShowAllFiles -bool FALSE
killall Finder
~/bin/show-dotfile :```
#!/bin/sh
defaults write com.apple.finder AppleShowAllFiles -bool TRUE
killall Finder
So in order to toggle the setting in the graphical finderyou drop to the commandline set the flag in the desired state and restart the finders. Works nice… One remark : if you suddenly see strange icons on your desktop, then you probably still have the dotFiles visible selected. **hide-dotfiles** will clean your desktop up again. \*