Which of the following is the best way to list all defined shell variables?
Correct Answer: B
The set command is used to display or modify the shell variables and functions in the current shell. When used without any arguments, it prints the names and values of all shell variables, including environment variables and user-defined variables, in alphabetical order. The output also includes the shell options and the positional parameters. The set command can be used in any POSIX-compliant shell, such as bash, zsh, ksh, etc123. The other options are not correct because: * env is used to print or modify the environment variables, not the shell variables. It does not show the user-defined variables or the shell options. It can also be used to run a command in a modified environment45. * env -a is an invalid option for the env command. The -a option is not supported by the env command in any standard or common implementation45. * echo $ENV is used to print the value of the environment variable ENV, not the list of all shell variables. The ENV variable is usually set to the name of a file that contains commands or aliases to be executed by the shell. It is mainly used by the ksh and some versions of bash . References: 1: How can I list all shell variables? - Unix & Linux Stack Exchange 2: 2.1 Command Line Basics - Linux Professional Institute Certification ... 3: set - The Open Group Base Specifications Issue 7, 2018 edition 4: How to set and list environment variables on Linux 5: env - The Open Group Base Specifications Issue 7, 2018 edition : What is the difference between .bash_profile and .bashrc? - Unix & Linux Stack Exchange : ENV - The Open Group Base Specifications Issue 7, 2018 edition
Question 77
Which configuration file does sudo read when determining if a user is permitted to run applications with root privileges?
Correct Answer: D
Question 78
Which command, depending on its options, can display the open network connections, the routing tables, as well as network interface statistics. (Specify ONLY the command without any path or parameters.)
Correct Answer:
netstat
Question 79
Which of the following can the chage command NOT change?
Correct Answer: E
The chage command can change the following parameters related to user password expiry and aging: * The last password change date (-d or --lastday option) * The password expiry date (-E or --expiredate option) * The minimum number of days between password changes (-m or --mindays option) * The maximum number of days during which a password is valid (-M or --maxdays option) * The number of days of warning before password expires (-W or --warndays option) The chage command cannot change the number of days of inactivity after a password has expired before the account is locked. This parameter is controlled by the -I or --inactive option of the usermod command, which modifies the user account information. The chage command only displays the current value of this parameter, but does not allow changing it. References: * chage command in Linux with examples - GeeksforGeeks * 10 chage command examples in Linux [Cheat Sheet] - GoLinuxCloud * How to Use the Chage Command in Linux - TecAdmin * How to Manage User Password Expiration and Aging in Linux - Tecmint
Question 80
Which of the following tasks can the date command accomplish? (Choose two.)