Chapter 8 Challenges

From Linux Shell Scripting Tutorial - A Beginner's handbook
Jump to: navigation, search
← exec commandHomeChapter 9: Functions →
  • Decide whether the following sentence is true or false:
  1. You can make the shell variable known to subshells with export command.
  2. To suspend a foreground process in a screen press CTRL+C.
  3. Commands enclosed within parentheses (...) are always executed in a subshell.
  4. CTRL+C sends a single to background process.
  5. To launch a gedit text editor as a background process append an ampersand to the end of gedit command. gedit &
  6. To send a SIGKILL (KILL or 9) to all running process use the kill command. kill -KILL pid
  7. Process is on the run queue means it is in runnable (R) state.
  8. init process always has PID 1.
  9. Every process has a parent.
  10. You can also trap the EXIT (0) signal with the trap command.
  11. All process in Linux starts with a process called "fork and exec".
  12. 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.
← exec commandHomeChapter 9: Functions →