Customizing AIX Prompt
2015-09-08 11:26
405 查看
Proper prompt make users easy to know who they are, what privilege they have, where they are, so that to reduce the change of making unnecessary mistakes.
The following is a little tip on setting up PS1 environment variable.
To modify the following two files to make it different for root and ordinary users.
For root, modify /.profile as below. (File permission should be, chmod 640 /.profile)
PS1="$(whoami)@$(hostname)(\$PWD)# "
export PS1
the prompt appears as
root@server01(/)#
For ordinary users, modify the default /etc/security/.profile as below.
PS1="$(whoami)@$(hostname)(\$PWD)$ "
export PS1
the prompt appears as
hankcen@server01(/home/hankcen)$
To change for an existing user, modify file /$HOME/.profile (after the change, chmod 540 /$HOME/.profile)
PS1="$(whoami)@$(hostname)(\$PWD)$ "
export PS1
I suggest that not to set PS1 in file /etc/profile file, but you can. This will apply the change to all users if they do not have PS1 environment variable set, and the change will be override
by the user's .profile. (After the modification, set file permission as, chmod 555 /etc/profile)
PS1="$(whoami)@$(hostname)(\$PWD)# "
export PS1
Disclaimer: All the information presented in this document is provided on the basis of as is and is meant for reference purpose only without any expressed or implied warranty. Use of the information
and its application in any form is sole discretion and responsibility of the user. The AUTHOR of this document is not responsible for any damage or loss arising out of use of information presented in this document.
原文地址:http://it.toolbox.com/blogs/my-two-cents/customizing-aix-prompt-32801
The following is a little tip on setting up PS1 environment variable.
To modify the following two files to make it different for root and ordinary users.
For root, modify /.profile as below. (File permission should be, chmod 640 /.profile)
PS1="$(whoami)@$(hostname)(\$PWD)# "
export PS1
the prompt appears as
root@server01(/)#
For ordinary users, modify the default /etc/security/.profile as below.
PS1="$(whoami)@$(hostname)(\$PWD)$ "
export PS1
the prompt appears as
hankcen@server01(/home/hankcen)$
To change for an existing user, modify file /$HOME/.profile (after the change, chmod 540 /$HOME/.profile)
PS1="$(whoami)@$(hostname)(\$PWD)$ "
export PS1
I suggest that not to set PS1 in file /etc/profile file, but you can. This will apply the change to all users if they do not have PS1 environment variable set, and the change will be override
by the user's .profile. (After the modification, set file permission as, chmod 555 /etc/profile)
PS1="$(whoami)@$(hostname)(\$PWD)# "
export PS1
Disclaimer: All the information presented in this document is provided on the basis of as is and is meant for reference purpose only without any expressed or implied warranty. Use of the information
and its application in any form is sole discretion and responsibility of the user. The AUTHOR of this document is not responsible for any damage or loss arising out of use of information presented in this document.
原文地址:http://it.toolbox.com/blogs/my-two-cents/customizing-aix-prompt-32801
相关文章推荐
- AIX mount: 0506-351 错误处理
- 0403-027 The parameter list is too long
- aix学习网站
- 学习AIX感悟
- AIX
- 分区环境中的AIX安装
- aix5.3 如何安装 openssh ?
- CDE(通用桌面环境)的安装和初始设定
- AIX操作系统概述
- AIX 常用命令汇总
- AIX系统ROOTVG镜像操作
- AIX问题诊断
- 在AIX上安装RPM格式软件包
- 安装AIX基于 Web 的系统管理器的方法
- 使用AIX系统及基本命令
- 介绍p5-520 和 p5-550服务器中运行AIX 5L V5.2时通过内置硬盘支持多个分区
- AIX主机上清除告警黄灯方法总结
- AIX系统更换本地硬盘
- AIX,HPUX,Tru64,Solaris,Linux 命令比较1
- AIX,HPUX,Tru64,Solaris,Linux 命令比较2