shorten command prompt current path
Hi,
using terminal console, when i change directory into a deep one, the command prompt path on the left shows the whole path, this way it almost fills the whole width of the screen. Can someone tell me a method to make it show only the last dir name so that there is more space for me to input command line. Thanks, mrpc_cambodia |
Everything you ever wanted to know about bash prompts --> http://tldp.org/HOWTO/Bash-Prompt-HOWTO/
|
whatever you see as command prompt is because of the environment variable PS1.
Please paste the output of echo $PS1, so that i can help you out in better way. |
|
here is my $PS1 output:
\h:\W \u\$ |
That will give you the hostname up to the first '.' (\h) followed by the basename of the current working directory (\W) and finally your user name (\u). That PS1 wouldn't cause the behavior you describe. Even if you were in the directory /some/really/really/really/deep/dark/directory/bin, the \W would cause only the bin to be shown in your prompt. Are you sure it is a capital W, not a lower case w? Either way, the link I originally gave you has the answer, but I'll give a more precise link http://tldp.org/HOWTO/Bash-Prompt-HO...sequences.html.
|
Try setting this as your PS1
[\u@\h \W]\$ This way if you are /really/really/deep/inside/bin you will see prompt as [root@hostname bin]# I think that is what you what-- right?? |
Hi.
Another tutorial for comparison: http://www.ibm.com/developerworks/li...mpt/index.html A utility that has themes, can have different prompts for different applications, etc.: http://bashish.sourceforge.net/index.html (no recent updates). Best wishes ... cheers, makyo |
All times are GMT -5. The time now is 08:25 PM. |