- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- hostname along with home dir name
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2005 01:01 AM
06-08-2005 01:01 AM
How to set home directory so that it can show hostname along with home directory name ?
Thanks,
Shiv
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2005 01:03 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2005 01:08 AM
06-08-2005 01:08 AM
Re: hostname along with home dir name
. set this in a profile script such as /etc/profile if you want every user to have this setting (It shall already have a PS1 setting, just replace it).
. Do not forget to export this variable. IT can be done with "export PS1" line in the same profile script.
Regards,
Fred
"Reality is just a point of view." (P. K. D.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2005 01:10 AM
06-08-2005 01:10 AM
Re: hostname along with home dir name
Add the following line at the bottom of yoru .profile file
export PS1="$(hostname):\$PWD$ "
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2005 01:12 AM
06-08-2005 01:12 AM
Re: hostname along with home dir name
PS1=`date -u +%c `:`echo $LOGNAME@``hostname`' $PWD
[!#] '
SEP
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2005 01:53 AM
06-08-2005 01:53 AM
Re: hostname along with home dir name
PS1=`whoami`'@'`/usr/bin/hostname`': $PWD # '; export PS1
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2005 04:11 PM
06-08-2005 04:11 PM
Re: hostname along with home dir name
ID=`id -u`
HN=`uname -n`
UN=`who am i|awk '{print $1}'`
if [ $ID -eq 0 ]
then
PS1='[$UN@$HN $PWD]# '
else
PS1='[$UN@$HN $PWD]$ '
fi
Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2005 04:25 PM
06-08-2005 04:25 PM
Re: hostname along with home dir name
Add following line in your .profile
export PS1=[`hostname`]'$PWD >' this will give prompt like this
[hp371-10]/var/adm > (where hp371-10 is hostname and /var/adm is pwd). also you can customize this per your need.
cheers!!!
eknath
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2005 04:50 PM
06-08-2005 04:50 PM
Re: hostname along with home dir name
export PS1=`whoami`"@"`hostname`'$PWD'"->"
will give out like:
ganeshs@myserver/home/ganeshs->
----------------------------
export PS1=`hostname`'$PWD'"->"
will give out like:
myserver/home/ganeshs->
Regards
Ganesha Sridhara
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-08-2005 05:35 PM
06-08-2005 05:35 PM
Re: hostname along with home dir name
Enough have been provided in above posts so I would suggest exporting history for indivisual users. From my /etc/profile on all my servers for achiving this alongwith your original question.
export PS1=`hostname`:'$PWD>>'
export HISTFILE="/var/hp/hp/$LOGNAME"
export HISTSIZE=1000
HTH,
Devender
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-09-2005 01:14 AM
06-09-2005 01:14 AM
Re: hostname along with home dir name
for fantasy just try and see what happens;
:-)
PS1="`tput bold`$(hostname):`tput rmso`\$PWD\#"
Good Luck,