LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   SUSE / openSUSE (https://www.linuxquestions.org/questions/suse-opensuse-60/)
-   -   how to prevent listing hidden files from been shown? (https://www.linuxquestions.org/questions/suse-opensuse-60/how-to-prevent-listing-hidden-files-from-been-shown-302267/)

greythorne 03-16-2005 08:20 AM

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?

thnx

win32sux 03-16-2005 08:39 AM

ls without any options should not display hidden files, AFAIK...

check in your ~/.bachrc file to make sure there isn't an alias set for ls which is giving it the "-a" option...

Code:

cat ~/.bashrc | grep ls

greythorne 03-16-2005 08:46 AM

i couldn't find anything that says about ls.

thnx

abisko00 03-16-2005 08:47 AM

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.

whansard 03-16-2005 08:49 AM

run the command
alias
and all aliases will be shown.
unalias ls
is a quick fix that will only work for that login session

perfect_circle 03-16-2005 09:01 AM

when putting \ before a command, then the real command is executed and not the existing allias.
SO
Code:

\ls
will run the real ls command.
To permantly fix it do what the others told you.
If you are running as root all the time, stop doing it....


All times are GMT -5. The time now is 04:15 AM.