bash configuration files
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. TIA, |
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.
|
I thought I checked these and didn't see it in there but I will look again. Thanks.
|
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. hth --Jonas |
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. Thanks again |
All times are GMT -5. The time now is 12:55 PM. |