I have lot of questions about scripts. How to configure the script that 1 It automatically turns on when the computer is turned on? 2 I was possible start and close the script with console? 3 After closing console the script still have been work?
closed as too broad by αғsнιη, Sparhawk, Jeff Schaller♦, Kusalananda♦, Jesse_b Feb 6 '18 at 12:54
Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.
That's depend on what OS you are running. A program that starts when a computer is turned on is generally called a service. Traditional Unix way is to use rc script. If you used systemd, that should still be supported. See How does systemd use /etc/init.d scripts?
All scripts can be started from the console by design, just use their full path or have their directory in your path and use their name. Stopping a script can be done using CtrlC if running in the foreground, or ps and kill interactively from another script, or better, pkill when available. Depending on the signal and the script, it can be terminated gracefully or not.
A script launched with nohup and running in the background is unaffected when the console from where it was launched is closed.