Terminal and Shell Configuration
Hi,
Just a few things that are really annoying me... On the console... 1. How do I make bash the default shell for new users (currently it is sh)? 2. Where are the default settings stored (ie for things like alias)? 3. I have put a .bashrc in my home dir which adds some more aliases. When I log in they are not there ('echo $SHELL' shows the shell to be bash), but if I then run bash (inside itself), the new aliases appear. How do I fix this? In aterm (actually in any terminal)... 4. What is it called when the prompt is "user@host:dir$"? 5. All of my terminals only give me a "bash-2.05b$" prompt- how can I get the above instead? Thanks in advance Simon |
in modern Linuxes sh is just a link to bash so you dont have to bother yourself.
Your setting will be stored in you home dir in file named .bash_profile try typeing the following to change the prompt Code:
export PS1="\u@\h:\w$" You can sutomize the shell prompt by changing the variable $PS1. Plz look at the bash info page for more infromation on $PS1 variable. |
3. I have put a .bashrc in my home dir which adds some more aliases. When I log in they are not there ('echo $SHELL' shows the shell to be bash), but if I then run bash (inside itself), the new aliases appear. How do I fix this?
--- .bashrc is not read from a login shell by default. To fix this, add the following to $HOME/.bash_profile: if [ -f ~/.bashrc ]; then source ~/.bashrc fi |
Thanks,
One more thing thats annoying me... Aterm (and xterm and rxvt) puts all coloured text in bold- I use a small font and it makes it very unclear- how can I stop the terminals from doing this? |
Surely someone knows how to stop the terminals from putting all coloured text in bold- your help would be greatly appreciated.
Thanks Simon |
I can tell you how Red Hat does it. You might have to investigate if your distros do it differently.
Essentially, the global bash configuration (/etc/profile) executes every script in /etc/profile.d. In that directory, there are a number of scripts, with one of them named colorls.sh. That script looks for a color definition file. It defaults to a global one, and then overrides that location if it finds a better one (in your home directory for instance). Then it executes the commands to create the colors in commandline utilities. What you're interested in is finding and editing the color definition file. For Red Hat, it looks for /etc/DIR_COLORS (as a default), and proceeds to look at your home directory for .dircolors or .dir_colors (along with some other gyrations based on the terminal type). Find the one the system is using, and modify it or copy it to your home directory. Open up a text editor, and scroll through the file. You'll see lots of numeric codes sprinkled throughout. For example, in my global definition file: Code:
# Below are the color init strings for the basic file types. A color init You'll likely have to log out for the changes to take effect. |
All times are GMT -5. The time now is 11:09 AM. |