Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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?

share|improve this question
up vote 2 down vote accepted

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

share|improve this answer
    
I know that one, but since I have a lot of .files and .dirs, it makes a mess of my finder. – jeroenvisser101 Nov 9 '13 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 '13 at 11:01
    
That's a shame actually, I will except your answer as it's closest as you could be :) Thanks! – jeroenvisser101 Nov 10 '13 at 10:56

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.

share|improve this answer

You must log in to answer this question.

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