LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 07-29-2004, 04:01 AM   #1
systemparadox
Member
 
Registered: Jul 2004
Location: Tavistock, Devon, England
Distribution: Slackware 9.1, Mandrake 9.0/9.1/10.0, LFS 6.0, Knoppix 3.1/3.3
Posts: 73

Rep: Reputation: 15
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
 
Old 07-29-2004, 04:16 AM   #2
bestofmed
Member
 
Registered: Jul 2004
Location: Jemna, Tunisia
Posts: 46

Rep: Reputation: 15
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$"
I'm not sure about the escape chars but give it a try it shall work.


You can sutomize the shell prompt by changing the variable $PS1. Plz look at the bash info page for more infromation on $PS1 variable.
 
Old 07-29-2004, 08:58 AM   #3
mikshaw
LQ Addict
 
Registered: Dec 2003
Location: Maine, USA
Distribution: Slackware/SuSE/DSL
Posts: 1,320

Rep: Reputation: 45
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
 
Old 07-30-2004, 08:32 AM   #4
systemparadox
Member
 
Registered: Jul 2004
Location: Tavistock, Devon, England
Distribution: Slackware 9.1, Mandrake 9.0/9.1/10.0, LFS 6.0, Knoppix 3.1/3.3
Posts: 73

Original Poster
Rep: Reputation: 15
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?
 
Old 08-12-2004, 11:55 AM   #5
systemparadox
Member
 
Registered: Jul 2004
Location: Tavistock, Devon, England
Distribution: Slackware 9.1, Mandrake 9.0/9.1/10.0, LFS 6.0, Knoppix 3.1/3.3
Posts: 73

Original Poster
Rep: Reputation: 15
Surely someone knows how to stop the terminals from putting all coloured text in bold- your help would be greatly appreciated.

Thanks
Simon
 
Old 08-12-2004, 12:48 PM   #6
Dark_Helmet
Senior Member
 
Registered: Jan 2003
Posts: 2,786

Rep: Reputation: 374Reputation: 374Reputation: 374Reputation: 374
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
# string consists of one or more of the following numeric codes:
# Attribute codes: 
# 00=none 01=bold 04=underscore 05=blink 07=reverse 08=concealed
# Text color codes:
# 30=black 31=red 32=green 33=yellow 34=blue 35=magenta 36=cyan 37=white
# Background color codes:
# 40=black 41=red 42=green 43=yellow 44=blue 45=magenta 46=cyan 47=white
NORMAL 00	# global default, although everything should be something.
FILE 00 	# normal file
DIR 01;34 	# directory
LINK 01;36 	# symbolic link
FIFO 40;33	# pipe
SOCK 01;35	# socket
BLK 40;33;01	# block device driver
CHR 40;33;01 	# character device driver
ORPHAN 01;05;37;41  # orphaned syminks
MISSING 01;05;37;41 # ... and the files they point to
As the comments at the top state, to make something bold, add a 01. To get rid of bold, just delete that same code.

You'll likely have to log out for the changes to take effect.

Last edited by Dark_Helmet; 08-12-2004 at 12:49 PM.
 
  


Reply



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
How do I open a text editor in a shell terminal? alex1986 Linux - Newbie 9 11-30-2005 03:52 PM
problem with the terminal and a shell script LinuxPadawan Linux - General 1 05-17-2005 10:29 PM
Restore video configuration from terminal leiterboss Linux - Newbie 1 04-26-2005 11:56 AM
Editing properties of your terminal/shell ? fredgt Linux - Software 3 10-03-2004 10:30 AM
Create Shell Shortcut for Terminal PhuckFonix Linux - Newbie 6 03-29-2004 07:36 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 09:22 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
Open Source Consulting | Domain Registration