Unhide all .htaccess files on mac

1

I am trying to unhide all the .htaccess files in my home folder. Below I've pasted what I'm using now, but it isn't working.

find ~/ -iname ".htaccess" | xargs chflags nohidden "{}"

Anyone knows why it keeps giving me errors that the file does not exists?

jeroenvisser101

Posted 2013-11-09T10:49:07.317

Reputation: 113

Answers

2

Changing the hidden/nohidden flags on a dotfile isn't going to make it appear. Finder always hides dotfiles, unless you set the AppleShowAllFiles property:

defaults write com.apple.finder AppleShowAllFiles -bool true
osascript -e 'quit app "Finder"'

That, however, will make all hidden files appear.

As for the errors you're getting, it's hard to tell. Not that it's going to make a difference because the files will still be hidden, but maybe try find ~ -iname '.htaccess' -exec chflags nohidden {} \;.

slhck

Posted 2013-11-09T10:49:07.317

Reputation: 182 472

I know that one, but since I have a lot of .files and .dirs, it makes a mess of my finder. – jeroenvisser101 – 2013-11-09T10:59:14.033

Unfortunately, it's not possible. You could maybe symlink the .htaccess files to htaccess ones that would be always visible. – slhck – 2013-11-09T11:01:39.733

That's a shame actually, I will except your answer as it's closest as you could be :) Thanks! – jeroenvisser101 – 2013-11-10T10:56:33.710

0

Make an alias file of the .htaccess file. Open Terminal app, navigate to the folder than contains the .htaccess file, and enter:

mv .htaccess\ alias htaccess

This will only create a visible file that links to the .htaccess file for editing and for only that one, not every .htaccess file.

Yokocapolo

Posted 2013-11-09T10:49:07.317

Reputation: 1