Linux - NewbieThis 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
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.
I've worked on various Unices over the years and am stumped and annoyed that I can't find the bash configuration files that are setting some environment variables and aliases that I don't like. I've looked at the .bash* files in my home directory and /etc/profile and /etc/bash* and don't see alias for ls set anywhere even though when I type alias at the command line ls is clearly set to
ls -F --color auto (I can barely read some of the lighter colors and want to remove the coloring altogether and for all terminals) I've read man pages for bash and ls, (having noticed there are also shell environment variables LS_COLORS and LS_OPTIONS set, which are not mentioned in the ls man page, which I also cannot find in any bash config file I've looked at. Where else do I need to look to find and change these defaults?
I know I could just add lines to unalias in my .bashrc file but it is annoying to not know where the aliases and environment variables are being set. Oh, and I'm using Mandrake 8.0 which I set up to dual boot on my old Win 95 machine.
I am not sure in Mandrake, but in Slackware there an /etc//profile file that has aliases in for the ls command. There might be a .profile in your home directory that has aliases set there too.
the naive, lame, stupid and highly effective brute force solution, of course, is to just
$ grep -r 'alias.*ls' /*
... but be sure to avoid stuff like queue and socket files. Perhaps you want to use find with exec.
I finally found it before I saw the brute force suggestion. I had dabbled with brute force a bit but I didn't wait patiently for results.
What I finally found by looking closely at the file /etc/profile was the little loop:
for i in /etc/profile.d/*.sh ; do
if [ -x $i ]; then
. $i
fi
done
and
grep alias /etc/profile.d/*.sh
turned up various alias definitions in a file named /etc/profile.d/alias.sh
and
grep LS /etc/profile.d/*.sh
showed the environment variable LS_OPTIONS set and used in /etc/profile.d/color.sh to define the offending ls alias.
Thanks for your help, I hope this short trail helps someone else. Does anyone know why they might have made the default profile so convoluted? It seems more complicated and obscure than necessary.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.