From: phunehehe on
Hello,
Do you feel the long full path annoying when working with deeply
nested folders? I see somebody have only the current folder name only
(as opposed to the whole full path), but I don't know how to config
konsole like that. Some help please?
Thanks
From: Henrik Carlqvist on
phunehehe <phunehehe(a)gmail.com> wrote:
> I see somebody have only the current folder name only
> (as opposed to the whole full path), but I don't know how to config
> konsole like that. Some help please?

The following works if you are using bash for your shell:

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

regards Henrik
--
The address in the header is only to prevent spam. My real address is:
hc3(at)poolhem.se Examples of addresses which go to spammers:
root(a)localhost postmaster(a)localhost

From: Sidney Lambe on
On alt.os.linux.slackware, Henrik Carlqvist <Henrik.Carlqvist(a)deadspam.com> wrote:
> phunehehe <phunehehe(a)gmail.com> wrote:
>> I see somebody have only the current folder name only
>> (as opposed to the whole full path), but I don't know how to config
>> konsole like that. Some help please?

"Folders" are found in Windows. In Linux we have "directories".

> The following works if you are using bash for your shell:
>
> export PS1="\u@\h:\W\$"
>

That'll work for him. I like to put everything but the simplest
prompt on one line and that prompt on the next:

PS1='\[ESC[1m\u:\w:\j\n\$ESC[0m\]'

root:/usr/doc/sed-4.1.5:0
#

That way you can have long directory listings _and_ a
lot of space at the prompt.

Those "ESC" are literal escapes, Ctrl-[. Different editors create
them in different ways. They are a part of what makes the prompt
display in bold. I like having it stand out on the screen.

That last number :0, is how many backgrounded processes
(Ctrl-z, etc.) there are in this window.

Sid

From: William Hunt on
On Sun, 11 Apr 2010, phunehehe wrote:
> Do you feel the long full path annoying when working with deeply
> nested folders? I see somebody have only the current folder name only
> (as opposed to the whole full path), but I don't know how to config
> konsole like that. Some help please?
> Thanks

simple answer: what Henrik says.

or, if you want to know what and how,
read man bash, the section "PROMPTING", which tells
how to put together a prompt, and a list of codes you
can use. Also a quick look at references to PS1.

system-wide config is in /etc/profile

Myself I like to color code prompts for different users.
I use yellow on red for root, green on black for user account.

root: export PS1='\[\033[41;1;33m\]:\w\$\[\033[0m\] '
user: export PS1='\[\033[1;32m\]\h\w\$\[\033[0m\] '

HTH
--
William Hunt, Portland Oregon USA
From: phunehehe on
On Apr 12, 12:55 pm, Henrik Carlqvist <Henrik.Carlqv...(a)deadspam.com>
wrote:
> phunehehe <phuneh...(a)gmail.com> wrote:
> > I see somebody have only the current folder name only
> > (as opposed to the whole full path), but I don't know how to config
> > konsole like that. Some help please?
>
> The following works if you are using bash for your shell:
>
> export PS1="\u@\h:\W\$"
>
> regards Henrik
> --
> The address in the header is only to prevent spam. My real address is:
> hc3(at)poolhem.se Examples of addresses which go to spammers:
> root(a)localhost postmaster(a)localhost

Thanks Henrik, it works for me.