基础组件

  1. sudo yum -y install wget git vim zip unzip net-tools lrzsz lsof

开机启动脚本

  1. # 开机启动配置
  2. sudo mkdir -p /data/log
  3. cd /etc/rc.d/init.d && touch autostart && chmod +x autostart
  4. cat >> /etc/rc.d/init.d/autostart << EOF
  5. #!/bin/bash
  6. # chkconfig: 2345 08 92
  7. # description: Description
  8. exec 2> /data/log/autostart.log # send stderr from rc.local to a log file
  9. exec 1>&2 # send stdout to the same log file
  10. echo "atuostart started" # show start of execution
  11. set -x # open log
  12. EOF
  13. chkconfig --add autostart && chkconfig autostart on
  14. cat >> ~/.zshrc << EOF
  15. alias vim-auto='vim /etc/rc.d/init.d/autostart'
  16. EOF
  17. source ~/.zshrc
  18. echo "执行成功,输入vim-auto即可编辑开机启动的命令"

alias脚本

  1. alias ll='ls -lh'
  2. alias size='f(){ du -sh $1* | sort -hr; }; f'
  3. alias gz='tar -zcvf'
  4. alias ungz='tar -zxvf'
  5. alias bz2='tar -jcvf'
  6. alias unbz2='tar -jxvf'
  7. alias now='date "+%Y-%m-%d %H:%M:%S"'
  8. alias vimbashrc='vim ~/.bashrc'
  9. alias reloadBashrc='source ~/.bashrc'