简体   繁体   中英

How do I run a shell command on startup on Linux?

Im using WSL and want run the shell command "export DISPLAY=:0" on startup so I can use gui applications. How do I do this?

You can use cron job to run shell automatically, (but cron service will not auto start when startup, you can use Windows Task Scheduler to auto start cron service, or you can create a ink file %sudo ALL=NOPASSWD: /etc/init.d/cron start )

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM