Score:1

How do I open terminal and run commands in it on startup and keep it open?

in flag

Tried to run batch script on terminal at startup using crontab and /etc/rc.local but they dont work. I dont know what has gone wrong as there is no log to check Here is the line on crontab @reboot user /home/user/script.sh ; /usr/bin/gnome-terminal -- bash -c "/home/user/script2.sh; exec bash" and on rc.local /home/user/script.sh ; /usr/bin/xterm -hold -e /home/user/script2.sh

in flag
Rather than crontab, it’s generally recommended that you [define a service](https://askubuntu.com/a/1151089/1222991) to accomplish this goal. It is much more reliable than crontab
hr flag
A *terminal emulator* usually runs in a user's *desktop session* after they have logged in - none of which happens `@reboot`. See instead [How do I start applications automatically on login?](https://askubuntu.com/questions/48321/how-do-i-start-applications-automatically-on-login)
Score:1
cn flag

A terminal emulator such as xterm or Gnome Terminal can only run on a graphical server (Xorg or increasingly Wayland). There is no chance you can start that before the graphical environment has been setup.

During log in, however, you can automatically launch a terminal emulator. To keep the terminal open when the command has finished, you could add a "bash" command at the end so the terminal stays open at a bash prompt, or, in Gnome Terminal, edit the profile to specify that the terminal should remain open.

Score:0
co flag

You can try creating a service as described here: https://medium.com/@benmorel/creating-a-linux-service-with-systemd-611b5c8b91d6

Services are like "background jobs": they can be enabled to start on startup. I am not an expert, but I think cronjobs are more oriented to scheduled tasks (e.g. make a backup of the system every night at 2 a.m.).

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.