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?

2 Answers 2

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 {} \;.

3
  • I know that one, but since I have a lot of .files and .dirs, it makes a mess of my finder. Nov 9, 2013 at 10:59
  • Unfortunately, it's not possible. You could maybe symlink the .htaccess files to htaccess ones that would be always visible.
    – slhck
    Nov 9, 2013 at 11:01
  • That's a shame actually, I will except your answer as it's closest as you could be :) Thanks! Nov 10, 2013 at 10:56
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.

You must log in to answer this question.

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