Alpha 服务器
1752647 成员
5314 在线
108788 解答
新建帖子

如何显示hostname?

 
xiaodong_hu
初中学生

如何显示hostname?

如何在#后面显示主机名呢? 谢谢!
2 条回复2
王峻
本科生

如何显示hostname?

Add these into your profile:

export PS1='#'`hostname`

But you better use these:

export PS1='$LOGNAME@`hostname`'#' in profile of root.



Example:

ming:#export PS1='#'`hostname`'>'



#ming>export PS1='$LOGNAME@'`hostname`'#'



root@ming#
XinxingPei
小学生

回复: 如何显示hostname?

只知道hp-ux下:#export PS1=`hostname`['$PWD']#可以