Answers - Background Processes Practice Exercises

Answers

  1. Start a new tmux
[username]$ tmux new -s s1
  1. What’s your working directory inside the tmux?
[usename]$ pwd
/home/username/data/practice_directory
  1. Change to the data/fastqc directory
[username]$ cd data/fastqc/
  1. Exit the tmux

Hit Ctrl + B, then d to detach the tmux. The message [detached (from session s1)] should print to your terminal and the commands and the green bar from the tmux should vanish and your previous commands should reappear.

  1. What’s your working directory now?

Notice it’s not the directory you changed to inside the tmux

[username]$ pwd
/home/kkeith/data/practice_directory
  1. Reattach the tmux
[username]$ tmux attach -t s1
  1. Again, what’s your working directory?

See, your working directory stayed the same inside the tmux. Everything you do inside the tmux is pretty independent of what you do outside the tmux.

[kkeith]$ pwd
/home/kkeith/data/practice_directory/data/fastqc
  1. Detach the tmux and kill it

Again, hit Ctrl B + d to detach the tmux

[detached (from session s1)]
[username]$ tmux kill-session -t s1