Chapter 8 Challenges
From Linux Shell Scripting Tutorial - A Beginner's handbook
- Decide whether the following sentence is true or false:
- You can make the shell variable known to subshells with export command.
- To suspend a foreground process in a screen press CTRL+C.
- Commands enclosed within parentheses (...) are always executed in a subshell.
- CTRL+C sends a single to background process.
- To launch a gedit text editor as a background process append an ampersand to the end of gedit command.
- To send a SIGKILL (KILL or 9) to all running process use the kill command.
kill -KILL pid
- Process is on the run queue means it is in runnable (R) state.
- init process always has PID 1.
- Every process has a parent.
- You can also trap the EXIT (0) signal with the trap command.
- All process in Linux starts with a process called "fork and exec".
- A process has PID and file descriptors.
- Describe how the trap statement works
- Write a shell command to locate a specific process is running or not (for example, find out if mysqld process is running or not)?
- Write a shell command that will execute the command vim without forking.
- From vi it is possible to run date or ps aux command without wasting time spawning another process. Write a vi command syntax to run shell command to execute in same shell.
- How do you use set a trap that will work through out time of script execution.
- What is a process? What is the difference between a process and a program?
- What is a Linux daemon? Using an appropriate Linux command list some of the daemons on a Linux system you have access to.
- How do the terms parent and child relate to process creation?
- Run the pstree command. This will only work on a Linux. Why?
- Write a Linux command to send a signal to all processes.