一、自动执行的程序

1)一登录自动执行的脚本。 .bashrc

[root@jenkens ~]# ll -a
总用量 90336
dr-xr-x---.  5 root root     4096 11月  1 19:11 .
dr-xr-xr-x. 17 root root      244 10月 27 17:37 ..
-rw-------.  1 root root     1580 10月 28 01:32 anaconda-ks.cfg
-rw-------.  1 root root     3622 11月  1 13:29 .bash_history
-rw-r--r--.  1 root root       18 12月 29 2013 .bash_logout    # 退出自动执行
-rw-r--r--.  1 root root      176 12月 29 2013 .bash_profile
-rw-r--r--.  1 root root      176 12月 29 2013 .bashrc        # 登录自动执行
drwx------   3 root root       17 10月 30 21:07 .cache
-rw-r--r--.  1 root root      100 12月 29 2013 .cshrc
-rw-------   1 root root       12 10月 30 20:54 .python_history
-rw-r--r--.  1 root root      129 12月 29 2013 .tcshrc
-rw-------   1 root root     4388 11月  1 13:32 .viminfo

比如新增执行脚本命令

[root@jenkens ~]# cat .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

echo "hello centos7"    # 新增内容

2)退出自动执行程序。.bash_logout

 

posted on 2018-12-24 10:58  可口_可乐  阅读(344)  评论(0编辑  收藏  举报