Operating System - HP-UX
1844208 Members
2661 Online
110229 Solutions
New Discussion

Add username/uname -n to command line prompt

 
SOLVED
Go to solution
CB_6
New Member

Add username/uname -n to command line prompt

Hi all

Can someone please remind me how to add the hostname and any other details to the command line prompt (default # or $).

Many thanks

CB
3 REPLIES 3
Maz_2
Advisor

Re: Add username/uname -n to command line prompt

Hiya,

Change PS1 in your .profile

Maz
Rainer von Bongartz
Honored Contributor
Solution

Re: Add username/uname -n to command line prompt

put something like this

PS1="`whoami`@`hostname`"

in your profile


Regards
Rainer
He's a real UNIX Man, sitting in his UNIX LAN making all his UNIX plans for nobody ...
Michael Duthie
Trusted Contributor

Re: Add username/uname -n to command line prompt

Use the following

PS1=$LOGNAME@`hostname`:'$PWD # '

lets you know which directory you are in too.