Hide File by Extension in Linux

February 27, 2012

I was trying to hide the python compiled files .pyc when I run the ls linux command. By default, linux hides all files started with a dot.

The solution (for me) was to add/update this line in my .bashrc (in my home directory)

alias ls='ls --color=auto --hide="*.pyc"'

Just to let you know, when you run

ls -a

all files appear again. :D


comments powered by Disqus

Of course it is happening inside your head ... Click!