5

What's the shell session ?
job seems like a process, is it?
Can one shell prompt can manage multple shell sessions ?

2 Answers 2

6

Shell session is your current state/environment in the shell/terminal. You can have only one session in a shell/terminal.

Job is a process which runs in your shell.

You can list all your jobs by entering the jobs command.

E.g. when executing some process you can press Ctrl+Z and the previously running process will be suspended. You can then execute such commands as fg to bring it back to the foreground, or bg to run it in the background.

3

To see your current shell along with it's process ID, the process ID of parents and the process ID of current command use:

$ pstree -aps $$
systemd,1 splash fastboot kaslr
  └─lightdm,1050
      └─lightdm,1294 --session-child 12 19
          └─upstart,1883 --user
              └─gnome-terminal-,10481
                  └─bash,3612
                      └─pstree,15684 -aps 3612
  • $$ is the environment variable for the shell's process ID (3612).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .