---root家目录
[root@rhel5 ~]# pwd
/root
----查看所有文件
[root@rhel5 ~]# ls -la
total 128
drwxr-x--- 2 root root 4096 Jun 4 04:08 .
drwxr-xr-x 28 root root 4096 Jun 5 02:24 ..
-rw------- 1 root root 1041 Jun 3 08:46 anaconda-ks.cfg
-rw------- 1 root root 3443 Jun 4 08:54 .bash_history
-rw-r--r-- 1 root root 24 Jul 13 2006 .bash_logout
-rw-r--r-- 1 root root 191 Jul 13 2006 .bash_profile
-rw-r--r-- 1 root root 176 Jul 13 2006 .bashrc
-rw-r--r-- 1 root root 0 Jun 4 04:08 c1
-rw-r--r-- 1 root root 0 Jun 4 04:08 c2
-rw-r--r-- 1 root root 100 Jul 13 2006 .cshrc
-rw-r--r-- 1 root root 29623 Jun 3 08:46 install.log
-rw-r--r-- 1 root root 0 Jun 3 08:37 install.log.syslog
-rw------- 1 root root 35 Jun 5 02:07 .lesshst
-rw-r--r-- 1 root root 129 Jul 13 2006 .tcshrc
--.bash_profile会调用.bashrc
[root@rhel5 ~]# more .bash_profile
# .bash_profile
# Get the aliases and functions
if [ -f ~/.bashrc ]; then
. ~/.bashrc
fi
# User specific environment and startup programs
PATH=$PATH:$HOME/bin
export PATH
unset USERNAME
---.bashrc会调用/etc/bashrc
[root@rhel5 ~]# more .bashrc
# .bashrc
# User specific aliases and functions
alias rm='rm -i'
alias cp='cp -i'
alias mv='mv -i'
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
[root@rhel5 ~]#
小结:1,如果你要在重启或启动运行一些任务,可以直接在.bash_profile添加对应的脚本即可
2,/etc/bashrc最好不要改.除非你明白里面的含义
3,家目录有文件:.bashrc和.bash_profile,而/etc目录有bashrc
来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/9240380/viewspace-763029/ ,如需转载,请注明出处,否则将追究法律责任。