每次系统启动时如何运行程序?

2 autostart

bash 中的命令行是什么让程序在每次系统启动时都运行?

Den*_*son 5

向您的 crontab 添加一个条目以运行@reboot

@reboot command-to-run
Run Code Online (Sandbox Code Playgroud)

使用crontab -e编辑您的crontab。

来自man 5 crontab

可能会出现八个特殊字符串之一,而不是前五个字段:

         string         meaning
          ------         -------
          @reboot        Run once, at startup.
          @yearly        Run once a year, "0 0 1 1 *".
          @annually      (same as @yearly)
          @monthly       Run once a month, "0 0 1 * *".
          @weekly        Run once a week, "0 0 * * 0".
          @daily         Run once a day, "0 0 * * *".
          @midnight      (same as @daily)
          @hourly        Run once an hour, "0 * * * *".
Run Code Online (Sandbox Code Playgroud)