Re: How to show the real directory instead of "~" (=HomeDir) in prompt pattern ?
- From: Aragorn <stryder@xxxxxxxxxxxxxxx>
- Date: Fri, 02 Jun 2006 15:26:34 GMT
On Friday 02 June 2006 15:49, Stephen Neal stood up and spoke the
following words to the masses in /comp.os.linux.misc...:/
Ok, I could define a new prompt with
export PS1='\h:\w> '
but whenever I am in my home directory the directory name is replaced
by a "~" How can I force Linux to show the full directory name in this
case as well ?
You can use *\W* instead of *\w* for the basename of the directory, but
I personallly use *\$PWD* in my command prompt.
It displays the complete path to the working directory, which may turn
out a little too wide if you're working at a deeply nested level, but I
have my consoles use a 1600*1200 pixel resolution - i.e. 200x75
characters - via the framebuffer.
I've put the following in my */etc/bashrc,* which makes it systemwide -
just try it in a terminal window and see whether you like it...: ;-)
PS1="\n[\d - \t][\h:\$PWD]\n[vc/\l - \u] \\$> "
The dollar sign will also change to a "#" when you're logged in as - or
/su'ed/ to - the root account. ;-)
Lastly, there are also a couple of very elaborate /Bash_Prompt_HowTo's/
with numerous examples on...
http://www.tldp.org
.... if you want a more sophisticated prompt. ;-)
--
With kind regards,
*Aragorn*
(Registered GNU/Linux user #223157)
.
- Prev by Date: Re: LCD monitor in portrait mode
- Next by Date: Re: LCD monitor in portrait mode
- Previous by thread: Re: How to show the real directory instead of "~" (=HomeDir) in prompt pattern ?
- Next by thread: Re: How to show the real directory instead of "~" (=HomeDir) in prompt pattern ?
- Index(es):
Relevant Pages
|
Loading