用户管理六

9.6 为命令clear设置别名为cl,使其在登录shell中生效

9.6.1 设置别名

[root@localhost test]#alias
[root@localhost test]#alias cl=clear
[root@localhost test]#cl

alias

9.6.2 其在登录shell中生效

1. 修改配置文件

[root@localhost test]#vim /root/.bashrc

加入
alias cl='clear'

alias

2. 使其生效

[root@localhost test]#source /root/.bashrc

3. 测试

[root@localhost test]# bash
[root@localhost test]# pstree

alias

发布了96 篇原创文章 · 获赞 8 · 访问量 4379

猜你喜欢

转载自blog.csdn.net/weixin_46108954/article/details/104468554