LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-15-2007, 03:56 PM   #1
peteraiea
LQ Newbie
 
Registered: Sep 2007
Location: Hawaii
Distribution: Suse 9.2
Posts: 7

Rep: Reputation: 0
bash ls


ref- OS: Suse 9.2, running kde, bash

ls behavior
bash "ls" when run by root seems to default to "ls -a" form, showing every normally hidden file.

When run as a regular user, it runs normally, that is hiding the dotted files.

ls is normal under "sh" for the root user.

what's with that? thanks!
 
Old 09-15-2007, 04:32 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,284

Rep: Reputation: 371Reputation: 371Reputation: 371Reputation: 371
Is ls aliased to ls -a for root? You can use the alias command to see all of the aliases that are currently set in the shell.
 
Old 09-15-2007, 05:40 PM   #3
peteraiea
LQ Newbie
 
Registered: Sep 2007
Location: Hawaii
Distribution: Suse 9.2
Posts: 7

Original Poster
Rep: Reputation: 0
yest that's it
ls is aliased to /bin/ls $LS_OPTIONS

now hunting around for where LS_OPTIONS is set for root ...

thanks
 
Old 09-15-2007, 08:42 PM   #4
farkus888
Member
 
Registered: Oct 2006
Distribution: usually use arch
Posts: 103

Rep: Reputation: 15
Code:
echo $LS_OPTIONS
will tell you what it is currently set to
Code:
LS_OPTIONS=whatever you want it to be, I like -l
Code:
export LS_OPTIONS
will set it for your current session.
as for changing it permanently try google. you could set your own options or remove the alias if you want it to behave "normally"
 
Old 09-16-2007, 03:06 AM   #5
Scroggs79
LQ Newbie
 
Registered: Feb 2006
Location: California
Distribution: Mandriva
Posts: 15

Rep: Reputation: 0
The defaults are set in /etc/bashrc and they can be overridden in a .bashrc or .bash_profile file in the home directory.
 
Old 09-16-2007, 03:26 AM   #6
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978Reputation: 1978
On Suse the settings for bash are in /etc/bash.bahsrc where you can see the relevant part:
Code:
if test "$UID" = 0 ; then
    LS_OPTIONS="-A -N $LS_OPTIONS -T 0"
else
    LS_OPTIONS="-N $LS_OPTIONS -T 0"
fi
You can see the difference from root and users. However, as already suggested, you do better modify LS_OPTIONS in ~/.bashrc. Bye
 
Old 09-17-2007, 12:45 AM   #7
peteraiea
LQ Newbie
 
Registered: Sep 2007
Location: Hawaii
Distribution: Suse 9.2
Posts: 7

Original Poster
Rep: Reputation: 0
that nails it.
In retro I could have tried a grep LS_ /etc/*rc which shows that csh also prescribes a set of ls defaults as well.

thanks all
P
 
  


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
passing variable from bash to perl in a bash script quadmore Programming 6 02-21-2011 04:11 AM
Bash development - move chmod options to bash jhwilliams Programming 9 06-26-2007 12:13 PM
Bash Sleep vs crontab and bash serial port nutthick Programming 4 06-01-2006 02:42 AM
Bash: Print usage statement & exit; otherwise continue using Bash shorthand operators stefanlasiewski Programming 9 02-07-2006 05:20 PM
why did bash 2.05b install delete /bin/bash & "/bin/sh -> bash"? johnpipe Linux - Software 2 06-06-2004 06:42 PM


All times are GMT -5. The time now is 07:47 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration