Last Updated on October 23, 2022 by InfraExam

Midterm Exam (Ch 1-8) Exam

  1. Which of the following is a valid variable assignment?

    • MY VAR= “set to one” 
    • alpha-init=5 
    • 2=xyz 
    • APP_VAR=’zero’
  2. Which of the following is not a valid variable name?

    • VAR_1 
    • _LPIC 
    • 2_VAR
  3. The ___________ command is used to display the value of a specific variable.

    • value 
    • set 
    • var 
    • echo
  4. The PATH variable directories are searched __________ when executing a command.

    • Including only the first 256 characters 
    • In no particular order 
    • Right to left 
    • Left to right
  5. Which of the following switches will include the full path in the prompt?

    • \W 
    • \w 
    • \e 
    • \H
  6. Which of the following is not a purpose for creating an alias?

    • To make commands run faster 
    • To create DOS-like commands 
    • To include a command option by default 
    • To create a short nickname for a long command or series of commands
  7. Which script is executed when you exit the shell?

    • ~/.bash_logout 
    • /etc/bashrc 
    • ~/.bashrc 
    • ~/.bash_profile
  8. The bash script_file command can be used to directly execute a shell script.

    True or False?

    • True 
    • False
  9. An ideal place for a regular user (not a super user), to place their shell scripts would be:

    • /sbin 
    • /usr/local/sbin 
    • /bin 
    • /home/james/bin
  10. When will the condition test -n STRING be true?

    • If the length of STRING is nonzero 
    • If the length of STRING is zero 
    • Always 
    • Never
  11. The return status from a command is 1. What does this indicate?

    • Command executed successfully 
    • Calculation done by the command yields the result 1 
    • Command is still running in the background 
    • Command did not execute successfully
  12. The statement if [ -d file ] will be true, if the file:

    • Is executable 
    • Is a directory 
    • Is writable 
    • Exists
  13. Accessibility within a GUI environment can be improved by which of the following?

    • Text-to-speech screen reader 
    • Automatic clicking 
    • Screen magnifier 
    • All choices are valid
  14. Which of the following shortcuts will enable/disable Sticky Keys?

    • Pressing the Enter key three times 
    • Pressing the Alt key three times 
    • Pressing the Shift key five times 
    • Pressing the F3 function key five times
  15. Visual cues like, flashing of window title bar on the complete screen, can be set using __________ keys feature.

    • Sticky 
    • Toggle 
    • Repeat 
    • Slow
  16. A normal (non root) user has which type of access to the /etc/passwd file?

    • Write only 
    • Read only 
    • Execute, read, and write 
    • Read and write
  17. The ________ command can be used to display user information, including information from the GECOS field.

    • passwd 
    • chage 
    • finger 
    • usermod
  18. Which of the following information is not stored in the /etc/shadow file?

    • Encrypted password 
    • Maximum number of days remaining for the password to expire 
    • Default home directory 
    • Days since last password change
  19. Password aging policy for individual users can be set using the ________ command.

    (choose two)

    • grep 
    • usermod 
    • getent 
    • passwd 
    • chage
  20. A Linux administrator modifies the values of UID_MAX and UID_MIN parameters in the /etc/login.defs file. This in effect will allow her to:

    • Change password expiration policy for existing users 
    • Assign UID within the specified range for new users 
    • Assign UID and GID within the specified range for all users 
    • Assign GID within the specified range for new users
  21. The ___________ command can be used to display group membership for a particular user.

    • showgrp 
    • getent 
    • groups
    • newgrp
  22. Root user can change password for any user using ________ command.

    • passwdmod 
    • change 
    • passwd 
    • usermod
  23. Using the command passwd -e test_user, the root user can force a password change in the next login attempt.

    True or False?

    • True 
    • False
  24. The chage command cannot be used to:

    • Delete a user 
    • View password aging policies 
    • Enforce a password changing and expiry policy for specific user accounts 
    • Update information related to password expiry
  25. Which of the following parameters is not referred by locale?

    • Character classification 
    • Digital signatures 
    • Monetary symbols 
    • Numeric representation
  26. Which command is used to list all available locales on the system?

    • locale -l 
    • locale -A 
    • locale -a 
    • locale
  27. Linux systems keep time in ____.

    • UTC 
    • IST 
    • GMT 
    • UST
  28. Which environment variable is used to find the time zone?

    • TIME 
    • TZ 
    • TZONE 
  29. What does UTF-8 mean?

    • UCS Technology Format 
    • UCS Transformation Format 
    • UCS Transcoding Format 
    • UCS Transfer Format
  30. The daemon associated with the cron utility is called the ___________ daemon.

    • crond 
    • crondaemon 
    • cdaemon 
    • cron
  31. Which of the following commands can be used to view the current contents of a crontab file?

    • crontab -l 
    • crontab -r 
    • crontab -p 
    • crontab -v
  32. How would you schedule a cron job to run every second?

    • By putting an entry similar to * * * * * <job> 
    • Using a cron job, it is not possible to schedule a job which runs every second 
    • Create 60 jobs which run every minute 
    • By using the keyphrase @second
  33. A one-time job needs to be scheduled for a specific time. Which of the following commands is most suitable for the task?

    • batch 
    • cron 
    • systemctl 
    • at
  34. The at.allow and at.deny files can be used to control access to:

    • The at command only 
    • The at and the batch commands 
    • The crontab command
    • All programs used for scheduling
  35. The batch commands are executed only when the system’s load average drops below which of the following by default?

    • 0.5 
    • 0.2 
    • 0.8 
    • 1.0
  36. X Windows, the latest GUI server for Linux, is a desktop from Microsoft.

    True or False?

    • True 
    • False
  37. Which of the following is not a component of the X Window system:

    • Widget/toolkit libraries 
    • Hardware drivers
    • Network manager 
    • Display manager
  38. If no desktop environment is installed, which of the following display managers is likely to be used?

    • lightdm 
    • kdm 
    • xdm 
    • gdm
  39. In order for the installed display manager to start automatically during the boot process, the default runlevel for Debian-derived distributions should be: 

    • Any level 
    • Between2 and 5
    • Less than 2 
    • More than 3
  40. In the Screen section of the /etc/X11/xorg.conf file, the DefaultDepth is set to 16. This means:

    • 65536 colors can be displayed 
    • 512 colors can be displayed 
    • 16 colors can be displayed 
    • 256 colors can be displayed