I would like to run a script in the background and to keep running even after I log out.
To run a command or script in the background use an ampersand, e.g.,
# ./long-running-script.sh &
This is equivalent to suspending the process with Ctrl-Z, and then issuing bg,
# ./long-running-script.sh ^Z + Stopped ./long-running-script.sh # bg + ./long-running-script & #
However, to keep the command running even after logging out use nohup, e.g.,
# nohup ./long-running-script.sh > ./long-running-script.log &  31163 # nohup: ignoring input and redirecting stderr to stdout
To manage processes in the background, the commands jobs, bg, and fg are useful
# jobs - Running nohup long-running-script.sh > ./long-running-script.log & + Running nohup some-other-script.sh & # fg 1 ...