Ch3 Configuring the Shell Exam

  1. An absolute path always starts with which character?

    • /
    • ~
    • \
    • .
  2. Environment variables are:

    • Only available to the shell they are created in
    • Passed into other shells and commands
    • Not used by shells at all
    • Are not a valid type of variable
  3. Environment variables can be viewed by running:

    (choose two)

    • vars
    • env
    • export -p
    • export -e
  4. Environment variables cannot be created by which command?

    • declare
    • set
    • export
    • typeset
  5. If you want to delete a variable, you can run:

    • unset
    • clear
    • wipe
    • delete
  6. In the PATH variable, the __ character is used to separate the directories.

    • ~
    • ;
    • /
    • :
  7. Local variables are:

    • Only available to the shell they are created in
    • Are not a valid type of variable
    • Not used by shells at all
    • Passed into other shells and commands
  8. Shell variables are used to:

    • Reboot the system
    • Hold critical system information
    • Prevent users from logging in
    • Hide passwords
  9. The PATH environment variable is used for:

    • Specifying locations that are writable for the user
    • Specifying directories to search for executable files
    • Specifying directories to contain documentation
    • Specifying locations where ordinary users can navigate
  10. The path /data/file.txt is:

    • An invalid path
    • A circular path
    • A relative path
    • An absolute path
  11. The PATH variable can be used under which situation?

    • The command is not found.
    • A full path name to a command is provided.
    • The command is a function.
    • The command is an alias.
  12. The path testdir/file.txt is:

    • A relative path
    • An absolute path
    • An invalid path
    • A circular path
  13. The /bin directory contains:

    • Nothing; it is not a valid directory
    • The most fundamental commands that are essential for the operating system to function
    • Commands that have been compiled from local sources
    • Essential administrative commands
  14. The _____ variable stores directories that the shell used to find executable files.

    • PATHS
    • PATH
    • DIR
    • CD
  15. The /sbin directory contains:

    • Essential administrative commands
    • Commands that have been compiled from local sources
    • The most fundamental commands that are essential
    • Nothing; it is not a valid directory
  16. The /usr/local/bin directory contains:

    • Nothing; it is not a valid directory
    • Commands that have been compiled from local sources
    • The most fundamental commands that are essential for the operating system to function
    • Essential administrative commands
  17. To process a script file in the current context, you execute:

    (choose two)

    • source
    • .
    • include
    • exec
  18. To view all current variables, you can use:

    • var
    • set
    • dump
    • view
  19. When specifying a path, the __ character symbolizes the current directory.

    • ~
    • ..
    • .
    • /
  20. Which character(s) cannot be placed in variable names?

    • Underscore _ character
    • Lower-case alpha characters
    • Upper-case alpha characters
    • Hyphen – character
  21. Which file can you place in your home directory to be executed when you log off the system?

    • ~/.bash_logout
    • ~/.bashrc
    • ~/.bash_profile
    • /etc/bashrc
  22. Which of the following commands will execute the last command that started with ec:

    • !!ec
    • !!
    • !-ec
    • !ec
  23. Which of the following files is for all bash shell users and executed every time a bash shell is opened?

    • ~/.bash_profile
    • ~/.bashrc
    • /etc/profile
    • /etc/bashrc
  24. Which of the following files is for all bash shell users and executed only at login?

    • ~/.bashrc
    • ~/.bash_profile
    • /etc/profile
    • /etc/bashrc
  25. Which of the following files is specific to each user and executed every time a bash shell is opened?

    • ~/.bash_profile
    • /etc/bashrc
    • ~/.bashrc
    • /etc/profile
  26. Which of the following files is specific to each user and executed only during login?

    • ~/.bashrc
    • ~/.bash_profile
    • /etc/bashrc
    • /etc/profile
  27. Which of the following is a valid way to add the /data directory to the existing PATH variable?

    • PATH=/data
    • PATH=$PATH:/data
    • $PATH=/data
    • $PATH=$PATH:/data
  28. Which of the following will create a variable?

    • variable+value
    • variable=value
    • variable value
    • variable~value
Subscribe
Notify of
guest
0 Comments
Newest
Oldest Most Voted
Inline Feedbacks
View all comments