how to prevent listing hidden files from been shown?
SUSE / openSUSEThis Forum is for the discussion of Suse Linux.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
how to prevent listing hidden files from been shown?
hi when i do "ls" in a terminal i get all the hidden files in my home listed now how do prevent it so that no-hidden files are shown and when i do "ls -a" it will show the hidden files as well?
AFAIK only root will get hidden files with 'ls'. This behaviour is defined in /etc/bash.bashrc:
Code:
# ls color option depends on the terminal
# If LS_COLROS is set but empty, the terminal has no colors.
#
if test "${LS_COLORS+empty}" = "${LS_COLORS:+empty}" ; then
LS_OPTIONS=--color=tty
else
LS_OPTIONS=--color=none
fi
if test "$UID" = 0 ; then
LS_OPTIONS="-a -N $LS_OPTIONS -T 0"
else
LS_OPTIONS="-N $LS_OPTIONS -T 0"
fi
So either you do not work as root or look if your /etc/bash.bashrc or .bashrc is different.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.