Answers - Background Processes Practice Exercises
Answers
- Start a new tmux
[username]$ tmux new -s s1
- What’s your working directory inside the tmux?
[usename]$ pwd
/home/username/data/practice_directory
- Change to the
data/fastqc
directory
[username]$ cd data/fastqc/
- 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.
- 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
- Reattach the tmux
[username]$ tmux attach -t s1
- 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
- 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