gzpk

linux启动执行某个脚本

  1. 如果是开机马上执行的脚本,可以将脚本写到rc.local中;

  2. 如果是用户登录后自动执行脚本,可以将脚本写到相应的用户目录下“~/.bash_profile”,若脚本“~/.bash_profile”不存在,可以直接拷贝“/etc/profile”命名为“~/.bash_profile”;

  3. 如果是要任一用户登录后自动执行脚本,可以将脚本写到“/etc/profile”中。

posted on 2015-09-18 09:51  gzpk  阅读(375)  评论(0编辑  收藏  举报

导航