w w w . T H E B I T S . c o . u k


How Do I Customise My Prompt?

Home Contents Previous Next

Here's a quick and easy way to customise your prompt.

- 1 -

Log-on as 'root'.

- 2 -

Enter:

cd /etc

- 3 -

Enter:

pico bashrc

- 4 -

Change the line:

PS1="[\u@\h \W]\\$ "

...to the following:

# PS1="[\u@\h \W]\\$ "
# e.g. '[root@localhost /etc]# _'

PS1="\[\W\] \\$ "
# e.g. '/etc # _'

- 5 -

Press Ctrl+o to save the file and then Ctrl+x to exit Pico.

- 6 -

Still in the '/etc' directory, enter:

source bashrc

...to activate the changes you've made.

Note

If you ever want to change back to the default prompt, simply add a '#' to the start of the line you want to be ignored and remove the '#' from the line you don't want to be ignored e.g.

# PS1="[\u@\h \W]\\$ "
# e.g. '[root@localhost /etc]# _'

PS1="\[\W\] \\$ "
# e.g. '/etc # _'

...becomes...

PS1="[\u@\h \W]\\$ "
# e.g. '[root@localhost /etc]# _'

# PS1="\[\W\] \\$ "
# e.g. '/etc # _'

By Laurence Hunter laurence@thebits.co.uk

Home Contents Previous Next

Download Latest Manual

www.THEBITS.co.uk - updated daily...