How to change the Linux prompt

Sometimes the Linux prompt doesn’t look really attractive and/or practical, like for example bash:/ or sh:/ which is really annoying.

To solve this, you need to use the PS1 environment variable and append to it what you need:

  1. Go to your home directory and create a .profile file
  2. edit the .profile file and add the following: “PS1=’$USER@$HOSTNAME $PWD \$ ‘”, this will give you something like: “john@myserver /home/john: “


About SoCRaT

Systems Engineer, OSS & Linux Geek
This entry was posted in Linux and tagged , , . Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s