Ask Ubuntu is a question and answer site for Ubuntu users and developers. 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 was wondering if there is some method to display .htaccess files by default in every folder i create it.

Is it possible to exclude .htaccess files from the hidden files? Maybe from the terminal

share|improve this question

You can use Ctrl+H if you are browsing files using Ubuntu File Browser (Nautilus)

share|improve this answer

You can set an alias to ls so that it will always list 'dot' files; the syntax varies a bit depending of the shell used; for bash it is:

alias ls='ls -a'

Add the above line to your ~/.bashrc. The drawback is this will list all files starting with a dot, every time.

share|improve this answer

In linux, every file with a "dot" in the start of its name is treated as hidden file. Being hidden is not some property that you can remove from a file, thereby excluding that file from hidden files. If you want to unhide a file, you need to change its name i.e if you want to remove .somefile from hidden files, you rename it to somefile. But I dont think that you can do the same with .htaccess because its a configuration file and if you rename it to htaccess your webserver will still be looking for .htaccess.

So, in short, I don't think it is possible to exclude .htaccess files from hidden files.

share|improve this answer

If you wanted only to show the the .htaccess dot file but keep the rest hidden you could add an alias to your bash configuration file for ls that uses grep to filter out the non-htaccess dotfiles.

alias ls='ls -a | grep ".*([.]htaccess$)|.*\d{2}:\d{2} ([^.].*$)|.*$"'

That regular expression is not working by the way, maybe someone with more experience could write the correct solution. But this method should give you what you want.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.