LinuxQuestions.org
Review your favorite Linux distribution.
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 06-19-2008, 01:36 PM   #1
dcbc
LQ Newbie
 
Registered: Mar 2008
Posts: 12

Rep: Reputation: 0
shell appearance.


while working in shell when i am in home directory i get this prompt
xxx@xxx-desktop:~$

when i change my directory my prompt changes something like this
xxx@xxx-desktop:~/download/ubuntu/xyz/zxy/weuir/weirerkj/sdodo$

i don't want this.

i want to get a simple prompt likethis
xxx@xxx-desktop:~$

what should i do.
 
Old 06-19-2008, 01:51 PM   #2
jailbait
LQ Guru
 
Registered: Feb 2003
Location: Blue Ridge Mountain
Distribution: Debian Jessie, Linux Mint 17
Posts: 7,790

Rep: Reputation: 292Reputation: 292Reputation: 292
You configure the bash prompt by the PS1 variable. You can set the prompt to hello with PS1=hello. This is explained in the bash man page under the PROMPT_COMMAND section.

You can make the prompt more elaborate by using escape characters and variables in PS1, for example:

PS1=$HOME

will change the prompt to the name of your home directory. Use the command:

printenv

to see other variables that you could possibly use. Other things that you can include in your prompt are described in the bash man page under PROMPTING. For example:

PS1="\u@$HOME"

Once you get PS1 the way that you want it you can make it permanent by placing it in a bash profile file under /home/user/. Different distributions use different bash profile files. Look for .bashrc, .bash_profile, or .profile.


--------------------
Steve Stites
 
Old 06-19-2008, 02:41 PM   #3
tommyr1216
Member
 
Registered: Sep 2004
Location: Pennsylvania
Distribution: Gentoo, Suse, Fedora, Slackware
Posts: 56

Rep: Reputation: 15
You might want to use:

PS1=\u@\h:\W\$

The capital W tells it to only use the base name of the current directory...so if you're in /etc/httpd you'd see user@host:httpd$.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Appearance multilingus SUSE / openSUSE 3 06-18-2006 07:27 AM
a few appearance questions Latem Mandriva 0 06-23-2005 09:06 AM
KDE Appearance Nullhellfire Slackware 4 03-27-2005 01:22 AM
mandrake appearance raffaello Linux - Software 1 10-24-2004 01:16 PM
IMAP questions: file locations, directory appearance, mail appearance alake Linux - Enterprise 1 04-29-2004 05:24 PM


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