Changing your prompt

The prompt can be changed by editing the PS1 environment variable in bash or the prompt environment variable in csh.

The PS1 variable is set by the bashrc setup file in /usr/etc/

PS1=”`whoami`@`uname -n` $ “

This changes the prompt to 

your_username@your_computer_name $ 

We can speed this up by replacing the “whoami” command with the environment variable $USER.

PS1=”$USER@`uname -n` $ “

For bash and tcsh, we can have many customisations to the prompt

PS1=”$USER@`uname -n` \t $ “

Now the prompt also shows the time

Advertisements

Leave a Reply

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

WordPress.com Logo

You are commenting using your WordPress.com 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 )

Google+ photo

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

Connecting to %s

%d bloggers like this: