LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This 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


Reply
  Search this Thread
Old 08-27-2009, 01:28 AM   #1
thomas2004ch
Member
 
Registered: Aug 2009
Posts: 539

Rep: Reputation: 33
A question about shell (bash shell)


I log in to a linux and the shell looks as follow:
Code:
[root@s003ap02-test ~]#
Now I change to another user with su - myuser and the shell looks different as follow:
Code:
-bash-3.00$
What I want is somewhat like this:
Code:
[myuser@s003ap02-test ~]#
How can I change that?
 
Old 08-27-2009, 01:32 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
# prompt is for root. $ is for normal user.

To get the # the prompt you need to be root.
 
Old 08-27-2009, 01:49 AM   #3
vishesh
Member
 
Registered: Feb 2008
Distribution: Fedora,RHEL,Ubuntu
Posts: 661

Rep: Reputation: 66
You can set whatever prompt you want
check enviroment variable PS1
By default prompt set by /etc/bashrc script.
Just check file /etc/bashrc, i think you will get your answer

thnks
 
Old 08-27-2009, 02:00 AM   #4
tulsi
Member
 
Registered: Aug 2009
Location: Chennai
Posts: 54

Rep: Reputation: 15
export PS1="[myuser@\h \W]"
display
[myuser@localhost ~]


if u want permanently above the name u will store .bashrc file.
 
Old 08-27-2009, 02:09 AM   #5
colucix
LQ Guru
 
Registered: Sep 2003
Location: Bologna
Distribution: CentOS 6.5 OpenSuSE 12.3
Posts: 10,509

Rep: Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983Reputation: 1983
Here is mine colorized in blue:
Code:
export PS1="\[\033[0;34m\][\u@linux \W]$\[\033[0m\] "
produces:
Code:
[alex@linux ~]$ 
 
  


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
in bash shell how to run shell script during startup rammohan04 Red Hat 2 07-31-2009 02:07 AM
copy directories and files recursively using C shell or bash shell bostonuser Programming 7 06-06-2008 01:24 AM
Bash shell scripting question. $Linuxnoob Fedora 13 04-01-2006 01:12 PM
Bash shell scripting question. pete1234 Programming 11 09-25-2005 02:59 AM
linux question about bash, shell ?? albina Linux - General 3 05-15-2002 01:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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