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
You can use Ctrl+H
if you are browsing files using Ubuntu File Browser (Nautilus)
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.
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.
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.