Situation1
command
find / -name "*.conf"- Ctrl+Z to pause the process
Situation2
--- hello.sh ---
#!/bin/bash
/bin/sleep 5000
command
./hello.sh &
Situation3
command
nohup ./hello.sh &
finally
command
pstree | less to get the processes info
|-sshd-+-sshd | |-sshd---bash | `-sshd---bash-+-find | |-2*[hello.sh---sleep] | |-less | `-pstree
then I exit the ssh
I get the pstree info in another ssh
init-| |-2*[hello.sh---sleep]
question
- Why do I run
hello.shand usenohupto suspendhello.sh, the result will be the same? - Why does the
findprocess not appear like thehello.shprocess? When parent process was killed ,initprocess will possess the orphan process. - Is it necessary to use
nohupif I want background a process?