1.shell的分类、分类和初始化

来源:互联网 发布:mac 放大图片 编辑:程序博客网 时间:2024/04/28 23:30
shell的分类
cat /etc/shells 可以查看可用shell
echo $SHELL 查看当前使用shell


shell的更改
'chsh -s dash 用户名'  或者修改/etc/passwd文件来修改使用shell


shell的初始化
账户在登陆/登出系统时读取的脚本文件:/etc/profile  ~/.bash_profile  ~/.bash_login ~/.profile ~/.bashrc /etc/bashrc ~/.bash_logout
        
登陆shell 和 非登陆shell   区别在于登陆时是否需要用户名  
'su -root' 属于登陆shell   直接打开终端就是非登陆shell


                         适用范围       非登陆shell    登陆shell
 
/etc/bashrc          所有账户        会读到          读到
/etc/profile           所有账户        不会读到      读到
~/.bashrc            当前账户        会读到          读到
~/.bash_profile    当前账户        不会读到      读到

0 0