Introduction to Linux I Chapter 4 Exam

Introduction to Linux I Chapter 4 Exam Answer

  1. Question ID 396

    If you want to delete a variable, you can run:

    • wipe
    • clear
    • delete
    • unset
  2. Question ID 397

    To view all current variables, you can use:

    • dump
    • var
    • view
    • set
  3. Question ID 398

    To process a script file in the current context, you execute:

    (choose two)

    • .
    • include
    • source
    • exec
  4. Question ID 399

    Environment variables can be viewed by running:

    (choose two)

    • export -e
    • vars
    • export -p
    • env
  5. Question ID 400

    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
  6. Question ID 401

    Which of the following will create a variable?

    • VAR+value
    • VAR=value
    • VAR value
    • Var~value
  7. Question ID 402

    Which character(s) cannot be placed in variable names?

    • Upper-case alpha characters
    • Hyphen (“-“) character
    • Underscore (“_”) character
    • Lower-case alpha characters
    • Numeric characters
  8. Question ID 403

    Shell variables are used to:

    • Reboot the system
    • Prevent users from logging in
    • Hide passwords
    • Hold critical system information
  9. Question ID 404

    Local variables are:

    • Are not a valid type of variable
    • Passed into other shells and commands
    • Only available to the shell they are created in
    • Not used by shells at all
  10. Question ID 405

    Environment variables are:

    • Only available to the shell they are created in
    • Are not a valid type of variable
    • Passed into other shells and commands
    • Not used by shells at all
  11. Question ID 406

    Environment variables cannot be declared by which command?

    • typeset
    • declare
    • export
    • set
  12. Question ID 408

    The PATH variable will be used under which situation?

    • The command is an alias.
    • The command is not found.
    • A full path name to a command is provided.
    • The command is a function.
  13. Question ID 409

    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. Question ID 410

    The /sbin directory contains:

    • Commands that have been compiled from local sources
    • Nothing; it is not a valid directory
    • The most fundamental commands that are essential
    • Essential administrative commands
  15. Question ID 411

    The /usr/local/bin directory contains:

    • The most fundamental commands that are essential for the operating system to function
    • Nothing; it is not a valid directory
    • Commands that have been compiled from local sources
    • Essential administrative commands
  16. Question ID 413

    The path testdir/file.txt is:

    • An invalid path
    • A relative path
    • A circular path
    • An absolute path
  17. Question ID 414

    The path /data/file.txt is:

    • A circular path
    • An absolute path
    • A relative path
    • An invalid path
  18. Question ID 417

    Which of the following is a valid way to add the /data directory to the existing PATH variable?

    • $PATH=$PATH:/data
    • PATH=$PATH:/data
    • $PATH=/data
    • PATH=/data
  19. Question ID 419

    Which of the following files is specific to each user and executed every time a bash shell is opened?

    • ~/.bashrc
    • ~/.bash_profile
    • /etc/bashrc
    • /etc/profile
  20. Question ID 420

    Which of the following files is specific to each user and executed only during login?

    • ~/.bash_profile
    • /etc/profile
    • /etc/bashrc
    • ~/.bashrc
  21. Question ID 421

    Which of the following files is for all bash shell users and executed every time a bash shell is opened?

    • /etc/bashrc
    • /etc/profile
    • ~/.bashrc
    • ~/.bash_profile
  22. Question ID 422

    Which of the following files is for all bash shell users and executed only at login?

    • ~/.bash_profile
    • ~/.bashrc
    • /etc/bashrc
    • /etc/profile
  23. Question ID 425

    Which of the following commands will execute the last command that started with ec:

    • !!
    • !!ec
    • !ec
    • !-ec
  24. Question ID 879

    An absolute path always starts with which character?

    • .
    • /
    • ~
  25. Question ID 880

    In the PATH variable, the __ character is used to separate the directories.

    • :
    • ;
    • ~
    • /
  26. Question ID 881

    The _____ command will allow you to see commands that you have previously executed.

    • hist
    • previous
    • history
    • last
  27. Question ID 882

    The _____ variable stores directories that the shell used to find executable files.

    • CD
    • DIR
    • PATHS
    • PATH
  28. Question ID 883

    When specifying a path, the __ character symbolizes the current directory.

    • ..
    • /
    • ~
    • .
  29. Question ID 884

    Which file can you place in your home directory to be executed when you log off the system?

    • /etc/bashrc
    • ~/.bash_logout
    • ~/.bashrc
    • ~/.bash_profile
  30. Question ID 885

    The _____ command will tell you if a command exists as a built-in command, function, alias or a command located within the PATH variable.

    • set
    • export
    • declare
    • type

Comments

comments