Print

 

Click Here to take the test. (You need an account. It's free)

 

1. When using a case statement within a shell script, which sequence denotes the ending of the case/switch statement?

2. Which of the following commands will execute a script and then exit the shell?

3. Which option to the export built-in command makes names available as functions to child processes?

4. Which character sequence is used to provide a default case when used within a case statement in a shell script?

5. Which sequence is used to mark the beginning and end of the commands to execute within a for loop in a shell script?

6. When sourcing a file in Bash, which chmod command would be necessary to provide the minimum privileges in order for the file to be sourced correctly, assuming that your current user owns the file?

7. You are working with a shell script called listusers and the script does not execute with the error "permission denied". What could be the possible cause of this issue?

8. Which character sequences denote an alternate command to execute if the preceding command does not exit successfully?

9. You have created an alias but it is gone the next time you log in. Which of the following best explains this scenario?

10. Which file test is used to determine if you are the owner of the file being tested?

11. Which environment variable contains the username of the currently logged-in user?

12. Within which directory should you place files to have them automatically copied to a user’s home directory when the user is created?

13. Which option to the readonly command marks a function as being read-only?

14. You have created a README file and placed it into /etc/skei so that users get the file in their home directories. The file is missing from some home directories on the system. Which of the following best explains this scenario?

15. Which file test operator is used to determine if the file is a symbolic link?

16. Which operator is used to test if a value is greater than or equal to something in a Bash script?

17. Which sequence of characters will execute two commands but only if the first command exits successfully?

18. Which find command will locate all files where the users have the execute bit set?

19. Which of the following best describes the PSI environment variable?

20. Which variable within a Bash script is used to access the first command-line parameter?

21. Which option to the export built-in command displays the list of exported variables?

22. Which of the following commands will obtain the date in seconds since the epoch and place it into a variable called DATE within a shell script?

23. Which keyword declares a block of code to be a function in a Bash script?

24. Which environment variable can be set if you want to automatically log users out of their shell after a certain period of inactivity?

25. You have a file containing bash functions. Which command can be used to add these functions to the current environment?

26. Which of the following tests the return value from the previous command to see if the command was successful?

27. You have specialized software that needs to be installed with an empty environment. Which option to the env command can be used to meet this requirement?

28. Which find command will locate all files named with an .sh extension?

29. Which of the following provides the end for an if conditional in a Bash script?

30. Which command within a shell script awaits user input and places that input into a variable?

31. Which command is used to read and execute commands from a file in the Bash shell?

32. Which keyword(s) is/are used to begin an alternate condition within a Bash script?

33. Which of the following is valid syntax to create a variable named FILENAME in a Bash script and set it equal to the second command- line argument?

34. Which option of declare displays output in a way that could then be used as input to another command?

35. When using the test built-in with one argument, what will be returned if its argument is not null?

36. Which of the following commands removes a currently defined aliased command?

37. You have a Bash script that uses the following find command: find . -name ".git" -type d When another administrator uses the script, it does not find all of the indicated directories. Which of the following is the best explanation for this scenario?

38. Which shell built-in command is used to display a list of read-only variables?

39. Which option to the set command enables debugging output?

40. Which file test operator is used to determine if the file is not zero size?

41. Which option of the declare command will create a variable that is read-only?

42. Which unset option can be used to remove a function from being defined?

43. You need to prompt the user to enter two values in a Bash script and capture them in variables VALI and VAL2, Which of the following commands can be used for this purpose?

44. Which mathematical operator is used for division within a Bash script?

45. Which characters are used to denote the beginning and end of the test portion of a while loop in a shell script?

46. Which of the following statements prepends the /usr/local/bin path to the path for a Bash shell?

47. Which option to the seq command sets a delimiter of a space between the numbers 1 through 5?

48. You need to create a function that will be available each time that you log in to the system. Within which file should this function be placed?

49. You need to view the current environment variables in a single line rather than with newlines separating each variable. Which option to the env command can be used for this purpose?

50. Which of the following statements adds the /srv/bin path to the path for a Bash shell?

51. When using a while loop in Bash, which character sequence marks the end of the loop?

52. Which option to the unset command explicitly informs the command that the name given refers to a shell variable and not a function?

53. Which option to bash will cause the shell to be executed without reading the initialization files?

54. Which of the following commands will print a list of 6 numbers beginning at 0 within a Bash script?

55. You need to send an email to the superuser if a command is successful. Which of the following commands will send mail from a Bash script?

56. Which of the following files is a systemwide initialization script for Bash?

57. Which option to the export built-in command removes a variable from being exported?

58. Which of the following commands removes an environment variable that has been set?

59. A command has the following listing obtained with ls - la: -rwsr-xr-x 1 john john 21 Oct 19 10:01 script.sh What does the s denote within the user permissions in the listing?

60. Assuming that a space-separated list of values has been defined as LIST="one two three four", which of the following for loop constructs will iterate through the elements in the list?

61. Which key sequence can be used to terminate a Bash script?

62. You are working with a user who is reporting that their environment does not have certain variables defined, but other users do have those same variables available within their environment on login. The issue was not corrected by having the user log out and then log in again, and you can see their successful login. What is the most likely explanation for this issue?

63. Which chmod command grants the user execute permission on a script?

64. Which of the following tests will determine if a file exists and can be read by the user executing the test?

65. Assume that you have a variable called $FILEPATH within a Bash shell script. Which characters can be used to ensure that the variable will be interpolated correctly regardless of where the variable appears within the script?

66. What is the order in which user configuration files are located on login to a Bash shell?

67. Which option enables debugging when used on the interpreter (#!) line within a Bash script?

68. When creating a shell script, which of the following commands is used to display the contents of variables?

69. Which character sequence can be used for command substitution in Bash?

70. Which of the following tests will determine if a file exists in the context of a shell script?

71. Which character or character sequence denotes the beginning of a while loop in a Bash script?

72. Which looping construct is executed at least once in a Bash script?

73. You receive an exit code of 1 when working with the grep command in a Bash script. What does exit code 1 mean with grep?

74. Which character or character sequence is equivalent to the source built-in in Bash?

75. According to the FHS, which of the following directories is used for local binaries?

76. When setting the shebang line of a shell script, which of the following commands will help to determine the location of the interpreter automatically?

77. Which environment variable is used when changing directory with the tilde character, such as cd ~ ?

78. You need a command to be executed on logout for all users. Within which file should this be placed (assuming all users are using Bash)?

79. Which test within a shell script whiie loop will examine one value to see if it is less than another?

80. If a variable has been created using the set command, which command can be used to remove the variable?

81. You are attempting to copy several files, but the cp command keeps asking for confirmation before overwriting. Which of the following best describes the most likely cause?

82. Which of the following files is executed with every interactive Bash shell invocation?

83. Which of the file test operators is used to determine if a file is a directory?

84. Which of the following will output the number 5 as part of a Bash script?

85. Which of the following commands ensures that the -la options are used when the is command is executed without other options?

86. What characters are used to mark a sequence of commands as a function in a Bash script?

87. Which variable is available to a Bash script and contains the name of the script itself?

88. Which of the following creates an array in a Bash script?

 

{jssocials}