My system is a single user so I really didn't need a reminder of who was logged in, nor onto which machine.
The original terminal prompt
[email protected]:~$ is rather long and not terribly useful to me, so I changed it to
current time : ~current directory $ indicates normal user prompt
Testing a new command prompt is straight forward and should be done prior to making it permanent. The default Ubuntu install uses BASH which is an acronym for Bourne Again SHell. A shell is a command language interpreter whose purpose is to provide an interface between the you and the kernel.
BASH command prompt is composed in a file named .bashrc with variables. The main variable is PS1. In a terminal using command
echo $PS1 will display a line that won't look like your command prompt at all!
The safe method to test all this
in a terminal enter
ORIG=$PS1 ............. saves current prompt
PS1='\@:\w\$' ... changes prompt to 12:58 PM:~$
PS1=$ORIG............... returns your original prompt
Many options are available for you to customize and adding color
None of the above changes are permanent - next login will return everything to original state.
After experimenting and customizing your command prompt to satisfaction you will need to make in permanent.
Making your choice permanent
The change requires editing of .bashrc
I suggest entering a second terminal to make changes to .bashrc - this provides an easy & accurate method to obtain the exact PS1 content
in another terminal enter
cp .bashrc .bashrc.bu .......... makes a backup of your current file
scroll to the section below - starts at line 59 on my machine
if [ "$color_prompt" = yes ]; then
copy the line between else and fi
enter a new line by hitting return with your cursor prior ti
enter a # before line starting PS1
enter your new prompt definition [the below example is from MY choice]
I strongly suggest changing ONLY the characters following }
Save the file; the next login will result in your chosen command prompt.
Login doesn't require a reboot - add the Log Out Button to the top panel. Right Click top panel,>add to panel>log out
Change your mind?
You made a copy of the original file so no editing is required here.
In a terminal enter
cp .bashrc.bu .bashrc
Next login will return your original command prompt