LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE
User Name
Password
SUSE / openSUSE This Forum is for the discussion of Suse Linux.

Notices


Reply
  Search this Thread
Old 03-16-2005, 08:20 AM   #1
greythorne
Member
 
Registered: Apr 2004
Posts: 363

Rep: Reputation: 30
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
 
Old 03-16-2005, 08:39 AM   #2
win32sux
LQ Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 380Reputation: 380Reputation: 380Reputation: 380
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

Last edited by win32sux; 03-16-2005 at 08:40 AM.
 
Old 03-16-2005, 08:46 AM   #3
greythorne
Member
 
Registered: Apr 2004
Posts: 363

Original Poster
Rep: Reputation: 30
i couldn't find anything that says about ls.

thnx
 
Old 03-16-2005, 08:47 AM   #4
abisko00
Senior Member
 
Registered: Mar 2004
Location: Munich
Distribution: Ubuntu
Posts: 3,517

Rep: Reputation: 58
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.

Last edited by abisko00; 03-16-2005 at 08:52 AM.
 
Old 03-16-2005, 08:49 AM   #5
whansard
Senior Member
 
Registered: Dec 2002
Location: Mosquitoville
Distribution: RH 6.2, Gen2, Knoppix,arch, bodhi, studio, suse, mint
Posts: 3,304

Rep: Reputation: 65
run the command
alias
and all aliases will be shown.
unalias ls
is a quick fix that will only work for that login session
 
Old 03-16-2005, 09:01 AM   #6
perfect_circle
Senior Member
 
Registered: Oct 2004
Location: Athens, Greece
Distribution: Slackware, arch
Posts: 1,783

Rep: Reputation: 53
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....
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
home directory files gone, hidden files remain Grasshopper Linux - Security 12 04-10-2005 08:23 PM
USB Hard Drive mounted: No files shown. mooreted Slackware 3 12-06-2004 06:51 PM
Vfat folders shown as un-known files Asad Debian 1 01-06-2004 04:20 PM
mount works, but no files shown bartgymnast Linux - Software 1 03-06-2003 07:00 AM
how to prevent directory listing in apache ? chuck77 Linux - General 7 12-21-2001 03:27 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > SUSE / openSUSE

All times are GMT -5. The time now is 04:38 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration