Forums
New posts
Articles
Product Reviews
Policies
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Menu
Log in
Register
Install the app
Install
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
"Invisify" files and directories in the Finder
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
<blockquote data-quote="gatorparrots" data-source="post: 1470"><p>You can show and hide invisible . files (dotfiles) in the Finder using the <strong>defaults</strong> command in the Terminal:</p><p><strong>Show all:</strong></p><p><span style="color: blue">defaults write com.apple.finder AppleShowAllFiles '1'</span></p><p><strong>Hide all:</strong></p><p><span style="color: blue">defaults write com.apple.finder AppleShowAllFiles '0' </span></p><p>Then relaunch the Finder:</p><p><span style="color: blue">kill -1 `ps auxc | grep Finder | awk '{print $2}'`</span></p><p></p><p>If the invibility bit has been set by another method than prepending a . before the filename, you may be better off with an application that can hide/show these files/folders that have an 'invisible' flag set:</p><p></p><p>(outdated link removed)</p><p></p><p>or</p><p></p><p>(outdated link removed)</p><p></p><p>(Yes, there is an English version.)</p><p></p><p><strong>Making files invisible</strong> </p><p>It is also possible to selectively make files & directories invisible rather easily.</p><p> </p><p>If the file/directory to be made invisible is on the root level, the easiest solution is probably to add 'dirname' (where 'dirname' is the file/directory to be hidden) to the <strong>.hidden</strong> file that lists items on the root level of the boot volume (<strong>/</strong>) to keep hidden from the Finder. Then relaunch the Finder to affect the change. Launch Terminal.app and issue these commands exactly as they appear below:</p><p><span style="color: blue">sudo -s</span></p><p><span style="color: blue">cp -p /.hidden /.hidden.default</span></p><p><span style="color: blue">echo 'dirname' >> /.hidden</span></p><p><span style="color: blue">exit</span></p><p><span style="color: blue">kill -1 `ps aucx | grep Finder | awk '{print $2}'`</span></p><p> </p><p>Alternately, if you have the Developer Tools installed, you can set the directory's invisbility bit:</p><p><span style="color: blue">/Developer/Tools/SetFile -a V /dirname</span></p><p> </p><p>If it is a non-root level directory to be made invisible, the command would be along these lines:</p><p><span style="color: blue">/Developer/Tools/SetFile -a V /Volumes/drivename/dirname</span></p><p>This will set the visiblity bit of the named file/directory on the non-boot drive, thus making it invisible to the Finder.</p></blockquote><p></p>
[QUOTE="gatorparrots, post: 1470"] You can show and hide invisible . files (dotfiles) in the Finder using the [B]defaults[/B] command in the Terminal: [B]Show all:[/B] [COLOR=blue]defaults write com.apple.finder AppleShowAllFiles '1'[/COLOR] [B]Hide all:[/B] [COLOR=blue]defaults write com.apple.finder AppleShowAllFiles '0' [/COLOR] Then relaunch the Finder: [COLOR=blue]kill -1 `ps auxc | grep Finder | awk '{print $2}'`[/COLOR] If the invibility bit has been set by another method than prepending a . before the filename, you may be better off with an application that can hide/show these files/folders that have an 'invisible' flag set: (outdated link removed) or (outdated link removed) (Yes, there is an English version.) [B]Making files invisible[/B] It is also possible to selectively make files & directories invisible rather easily. If the file/directory to be made invisible is on the root level, the easiest solution is probably to add 'dirname' (where 'dirname' is the file/directory to be hidden) to the [B].hidden[/B] file that lists items on the root level of the boot volume ([B]/[/B]) to keep hidden from the Finder. Then relaunch the Finder to affect the change. Launch Terminal.app and issue these commands exactly as they appear below: [COLOR=blue]sudo -s cp -p /.hidden /.hidden.default echo 'dirname' >> /.hidden exit kill -1 `ps aucx | grep Finder | awk '{print $2}'`[/COLOR] Alternately, if you have the Developer Tools installed, you can set the directory's invisbility bit: [COLOR=blue]/Developer/Tools/SetFile -a V /dirname[/COLOR] If it is a non-root level directory to be made invisible, the command would be along these lines: [COLOR=blue]/Developer/Tools/SetFile -a V /Volumes/drivename/dirname[/COLOR] This will set the visiblity bit of the named file/directory on the non-boot drive, thus making it invisible to the Finder. [/QUOTE]
Verification
Grass is to green, as mud is to ______?
Post reply
Forums
macOS & iOS Developer Playground
macOS - Development and Darwin
"Invisify" files and directories in the Finder
Top