Customizing terminal

I would like to customize a terminal’s detail that I don’t know the name, so it’s being hard to Google it. My terminal currently has the following layout:

user@hostname:current_dir>

Example:

renatov@dellnote:/usr/bin>

I don’t really like this layout (or whatever name this ‘thing’ has). I would like to change it to something else, for example:

user <current_dir> $

Could someone help me, please? If someone told me what is the name of this ‘thing’ I’m trying to customize, I would be able to Google it :slight_smile:

What you see in the terminal is based on
user
hostname

On Thu 13 Feb 2014 04:46:01 AM CST, renatov wrote:

I would like to customize a terminal’s detail that I don’t know the
name, so it’s being hard to Google it. My terminal currently has the
following layout:

Code:

user@hostname:current_dir>

Example:

Code:

renatov@dellnote:/usr/bin>

I don’t really like this layout (or whatever name this ‘thing’ has). I
would like to change it to something else, for example:

Code:

user <current_dir> $

Could someone help me, please? If someone told me what is the name of
this ‘thing’ I’m trying to customize, I would be able to Google it :slight_smile:

Hi
That is called PS1 and an alternative PS2, so to change it to the
above, it would be;


export PS1="$USER `pwd` $"

This command can be added to your ~/.basrc file or which ever shell
you using. Look at man bash then /PS1 <enter> to search and find the
other options.


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE 13.1 (Bottle) (x86_64) GNOME 3.10.2 Kernel 3.11.10-7-desktop
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!

Canada maid
this is good site

I used a bashrc generator to customize a very good looking $PS1. I added the following code to both my user’s ~/.bashrc and root’s ~/.bashrc so they have different $PS1 variables:

# Custom PS1if  $(id -u) -eq 0 ];
then # root
    export PS1="\\e[01;31m\]\u\\e[0m\]\\e[01;37m\]:\\e[0m\]\\e[00;37m\] \w \\e[0m\]\\e[01;31m\]#\\e[0m\]\\e[00;37m\] \\e[0m\]" 
else # normal user
    export PS1="\\e[01;31m\]\u\\e[0m\]\\e[00;37m\] \w] \\e[0m\]\\e[01;34m\]\$\\e[0m\]\\e[00;37m\] \\e[0m\]"
fi

Thanks for the help!

On 2014-02-13 05:46, renatov wrote:
> I don’t really like this layout (or whatever name this ‘thing’ has). I
> would like to change it to something else, for example:

Notice that the default setting, which is not that simple, contains the
machine name because people can ssh from one machine to another, and it
is useful to know what machine you are at.

You should not remove the machine name unless you are never going to
work with networked machines.


Cheers / Saludos,

Carlos E. R.

(from 13.1 x86_64 “Bottle” (Minas Tirith))

On Thu 13 Feb 2014 08:46:01 AM CST, renatov wrote:

I used a ‘bashrc generator’ (http://bashrcgenerator.com/) to customize a
very good looking $PS1, but now root has the same $PS1 as my user, so it
doesn’t appear a “#” when I login as root with su. How do I customize it
to providing different $PS1 variables to root and other users?

I tryed this code in my ~/.bashrc but it didn’t work:

Hi
Using that implies that you would not use su - (which should be used
when switching to root). In openSUSE there are some configuration
tweaks to make it color red. Only set you user profile, then set up the
root one in that account .bashrc.

If system wide then you need to look at /etc/bash.bashrc (make a backup
copy before making changes!).


Cheers Malcolm °¿° SUSE Knowledge Partner (Linux Counter #276890)
openSUSE 13.1 (Bottle) (x86_64) GNOME 3.10.2 Kernel 3.11.10-7-desktop
If you find this post helpful and are logged into the web interface,
please show your appreciation and click on the star below… Thanks!