Exercises

Exercises

The more practice you get with the tools in this class, the more comfortable, and faster with them you will become.

We haven’t learned how to use many tools yet, but we can still practice what we have learned. We want you to walk away from this chapter with a basic understanding of the terms presented and to be comfortable with Bash command structure, and the commands presented in the Walkthrough.

Practice

  • write down the absolute path for each of the following commands:
    • bash
    • which
    • echo
    • ls
    • users
    • cat
    • less
    • man
    • kill
  • use the man pages to read the DESCRIPTION of each of the previous commands

Questions & Answers

How many directories does your $PATH variable currently contain?

CLICK FOR ANSWER

9

  • /usr/local/sbin
  • /usr/local/bin
  • /usr/sbin
  • /usr/bin
  • /sbin
  • /bin
  • /usr/games
  • /usr/local/games
  • /snap/bin

What command was less based on? Check out the less man page for the answer!

CLICK FOR ANSWER
more

Is the answer from the previous question a command you can use?

CLICK FOR ANSWER
Yes try less /etc/passwd and more /etc/passwd

Does the command from the previous answer have a man page?

CLICK FOR ANSWER
YES try man more

How can you exit or terminate your currently running emulator?

CLICK FOR ANSWER
kill -9 $BASHPID

Is there any way you can terminate the terminal emulator using the terminal emulator window?

CLICK FOR ANSWER
YES click the red x button in the terminal emulator window.

There is a command built directly into Bash for exiting a Bash Shell. Can you guess it?

CLICK FOR ANSWER

exit. Using the built-in exit command is the preferred way to terminate a Bash Shell!