LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora
User Name
Password
Fedora This forum is for the discussion of the Fedora Project.

Notices


Reply
  Search this Thread
Old 11-11-2004, 12:50 PM   #1
benjithegreat98
Senior Member
 
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Rep: Reputation: 45
The command line interface's appearance in FC3


I am a command line junkie. I use it for just about every thing. But the default command line on FC3 sucks. When you open up a terminal screen or remotely log in you get this:

-bash-3.00$

When you log in as root you get the older version:

-bash-3.00$ su
Password:
[root@fedora benji]

How can I get my command line to look like [root@fedora benji] when I am logged in as both 'root' and 'benji' ?
 
Old 11-12-2004, 03:11 AM   #2
growler
Member
 
Registered: Apr 2002
Posts: 84

Rep: Reputation: 15
Put this in your .bashrc file:
Code:
# create a nice prompt
case $TERM in
    xterm*|screen|linux|cygwin|rxvt*)
      PS1='[\u@\h \[\e[36;1m\]\W\[\e[0m\]]\$ '
      ;;
    *)
      PS1='\s\v\$ '
      ;;
esac
The key variable is PS1; you'll find lots of different PS1 prompts through google. Also, you could put it in .bash_profile, or /etc/bashrc if you want the new prompt to appear by default for everyone.
 
Old 11-12-2004, 10:49 AM   #3
benjithegreat98
Senior Member
 
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Original Poster
Rep: Reputation: 45
Excellent!! Your contribution has been much appreciated.
 
Old 11-12-2004, 05:56 PM   #4
benjithegreat98
Senior Member
 
Registered: Dec 2003
Location: Shelbyville, TN, USA
Distribution: Fedora Core, CentOS
Posts: 1,019

Original Poster
Rep: Reputation: 45
Ok. I eventually found more of what I was looking for. I'll share:

In my home directory I created a .bashrc file w/ the contents of
Code:
# .bashrc

# Source global definitions
if [ -f /etc/bashrc ]; then
        . /etc/bashrc
fi
I also created a file named .bash_profile
Code:
# .bash_profile

# Get the aliases and functions
if [ -f ~/.bashrc ]; then
        . ~/.bashrc
fi
 
Old 11-13-2004, 12:59 AM   #5
growler
Member
 
Registered: Apr 2002
Posts: 84

Rep: Reputation: 15
Quote:
Originally posted by benjithegreat98
Excellent!! Your contribution has been much appreciated.
Great, glad that helped!
 
  


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
FC3: Command Line Cyberian Fedora 6 12-09-2004 08:43 AM
Command to output file content line by line aznluvsmc Programming 2 09-12-2004 07:45 PM
51 characters only in the 1st Line of command line eggCover Linux - General 2 07-29-2004 01:28 PM
Change appearance of command prompt Irving Linux - Software 2 06-09-2004 10:30 PM
IMAP questions: file locations, directory appearance, mail appearance alake Linux - Enterprise 1 04-29-2004 04:24 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions > Fedora

All times are GMT -5. The time now is 07:33 AM.

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