I want my Mac to show hidden files when i hit ⌘ + H (like ubuntu). I can see hidden files by putting this defaults write com.apple.finder AppleShowAllFiles YES
command in terminal but i want to get a keyboard shortcut for it. Also, if ⌘ + H is already used by some other process please let me know what might be the closest and most related shortcut for this new process and how to assign it to the respective, show hidden files process.
macOS Finder – How to Set a Keyboard Shortcut for Showing Hidden Files
finderkeyboardmacosshortcut
Related Question
- Terminal macOS Beta Seed Program – How to Enable or Disable OS X Beta Participation from Terminal
- MacOS – OSX High Sierra – Files and Folders show as empty/invisible in Finder, but are still there
- MacOS – Is it possible to keep dot files with specific extension unhidden in Finder
- Command Shift Period (show hidden files) stop working
- Keyboard Finder Catalina Shortcut Automation – Why Show Hidden Files Shortcut Works Intermittently
- Show/Hide Hidden Files in Finder with Non-US Keyboard
Best Answer
Edit at Nov 2018
This is all now moot since High Sierra. In Finder, Cmd ⌘ Shift ⇧ . [period, full stop] will toggle invisible files on the fly, nothing else needed.
Cmd ⌘ H is the system-wide shortcut for "Hide frontmost app"
To try tie a new shortcut to that, you could maybe use Automator to add a Service - but I still don't know how you would persuade it to override the existing System default.
This works as a Service if you use a non-system key, but not with Cmd ⌘ H
Edit for El Capitan…
I've noticed that the Finder window refresh no longer works in El Capitan, so this is a modified version, quitting the Finder instead.
I guess you could make it work for the Finder only, if you specified some other key command for Hide Finder - as it is visible as a Menu item it would be possible to override for that app alone [by putting something 'useless' as an alternative], leaving you free to then use Cmd ⌘ H to toggle invisibles from the Finder only.
Tested - does work this way