When I perform ls
in bash, I always see too many *.pyc
files. Is there any way to hide these files?
pyc files are placed in the same directory as the . py file. In Python 3.2, the compiled files are placed in a __pycache__ subdirectory, and are named differently depending on which Python interpreter created them. (This can be useful to people importing the same Python modules from multiple versions of Python.)
This way lies the dark side, but you could force ls
to never show them by adding something like
alias ls='ls --hide="*.pyc"'
to your .bashrc
. ls
will reveal the hidden files if you use -a
or -A
.
However, I would recommend just ignoring them in your head, or running this version of ls
when you really don't want to see them.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With