I have a directory where regardless of user or options selected, I would like it to always show hidden files.
I know the -a
option will show hidden files. I just want to automate the decision on using the option.
Say I'm in /home/user I don't care to see the hidden files, but if I'm in /filestoprcess I want to see the hidden files.
Does this type of functionality exists?
Best Answer
The easiest way I can think of to do this would be to create a shell alias that maps to a function. Say we're using bash and add the following alias to your
.bashrc
:Now, add the
ls_mod
function below:I haven't tested this, so I doubt it's perfect, but at least it gives you the idea. You may need to work to pass extra arguments to
ls
.