Linux users run a specified program

You can refer to the article:  https://www.cnblogs.com/jmliao/p/11823209.html

 

Specific Case Study:

# In the root user directly with the following command to execute the program, the program is executed, the program is part of the user git

su - git -c "nohup /home/git/gogs/gogs web >/dev/null 2>&1 &"

 

Guess you like

Origin www.cnblogs.com/faberbeta/p/linux-shell024.html