LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Suse/Novell
User Name
Password
Suse/Novell 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
Guru
 
Registered: Jul 2003
Location: Los Angeles
Distribution: Ubuntu
Posts: 9,870

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
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: SuSE, Ubuntu
Posts: 3,511

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, 98,2000 + various
Posts: 3,171

Rep: Reputation: 51
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: 52
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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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


All times are GMT -5. The time now is 10:39 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration