LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
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 01-08-2008, 07:30 PM   #1
tehkaao
Member
 
Registered: Mar 2007
Location: Canada
Distribution: Debian Lenny AMD64
Posts: 44

Rep: Reputation: 15
Shell not displaying normally.


Hello,
I know this is a minor annoyance but in CentOS 4.5 my shell displays -sh-3.00 under a user account but the normal hostname@directory is displayed in root. How do I get this displayed for all accounts?
 
Old 01-09-2008, 12:22 PM   #2
griffey
Member
 
Registered: Jan 2004
Location: East Central Illinois
Distribution: RHEL 4/5/6 and Fedora
Posts: 89

Rep: Reputation: 15
Look for a file in your user home directory .bashrc or .tcshrc--you can change how your prompt appears using that file.

Code:
set prompt=\[`id -nu`@`hostname -s`\]\#\"
G.--
 
Old 01-09-2008, 05:36 PM   #3
tehkaao
Member
 
Registered: Mar 2007
Location: Canada
Distribution: Debian Lenny AMD64
Posts: 44

Original Poster
Rep: Reputation: 15
Is there a way to change it for everyone?
 
Old 01-09-2008, 05:39 PM   #4
gilead
Senior Member
 
Registered: Dec 2005
Location: Brisbane, Australia
Distribution: Slackware64 14.0
Posts: 4,141

Rep: Reputation: 168Reputation: 168
On my systems (Slackware), I have the following in /etc/profile:
Code:
if [ "$SHELL" = "/bin/pdksh" ]; then
 PS1='! $ '
elif [ "$SHELL" = "/bin/ksh" ]; then
 PS1='! ${PWD/#$HOME/~}$ '
elif [ "$SHELL" = "/bin/zsh" ]; then
 PS1='%n@%m:%~%# '
elif [ "$SHELL" = "/bin/ash" ]; then
 PS1='$ '
else
 PS1='\u@\h:\w\$ '
fi
PS2='> '
export PS1 PS2
 
Old 01-10-2008, 06:54 AM   #5
griffey
Member
 
Registered: Jan 2004
Location: East Central Illinois
Distribution: RHEL 4/5/6 and Fedora
Posts: 89

Rep: Reputation: 15
All that stuff gets set globally in /etc/bashrc (in RedHat, at least, which I think CentOS is related to, right?).

Take a look at this article on messing with bashrc. I didn't know about some of what was listed on that page--I may be playing with bashrc for a while today too.

Good luck!

G.--
 
  


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
LXer: Shell tip: Set the shell prompt and themes in Linux Terminal LXer Syndicated Linux News 0 06-12-2007 03:02 AM
I made a shortcut to a shell script and it is using default shell icon... shlinux Linux - Software 2 04-20-2006 06:29 AM
Alias or shell script to confirm 'exit' commands from a shell rose_bud4201 Programming 2 03-08-2006 02:34 PM
'sh' shell - Actually calls legacy Bourne shell, or uses system default? Dtsazza Linux - Software 1 10-28-2005 09:20 AM
Displaying Uptime Das0 Programming 6 02-16-2004 04:37 PM

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

All times are GMT -5. The time now is 11:46 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