Basic Linux Practice Multiple Choice Questions – 05

21. Question: What is the main purpose of the chmod command in Linux?

Option 1: Change file permissions

Option 2: Create a new directory

Option 3: Display file contents

Option 4: Delete files

Correct Answer: 1

Explanation: The main purpose of the chmod command in Linux is to change file permissions. It allows you to modify the access permissions of files and directories. You can use it to control who can read, write, and execute specific files or directories.

22. Question: In Linux command redirection, what does 2>&1 mean?

Option 1: Redirect standard error (2) and standard output (1) to the same location

Option 2: Redirect standard error (2) to standard output (1)

Option 3: Redirect standard output (1) to standard error (2)

Option 4: Close standard error and standard output

Correct Answer: 1

Explanation: “2>&1” means that standard error (file descriptor 2) and standard output (file descriptor 1) are both redirected to the same location. This is commonly used to capture error messages and regular output during command execution.

23. Question: In file permissions, what does the “s” represent in the permission string “drwxr-sr-x”?

Option 1: Set user or group ID

Option 2: Sticky bit

Option 3: Synchronized access

Option 4: Special permissions

Correct Answer: 1

Explanation: In the permission string “drwxr-sr-x”, the “s” indicates the “set user or group ID” permission. When set on an executable file, it allows the user running the file to temporarily inherit the permissions of the file’s owner or group, depending on whether it is set on the user or group ID.

24. Question: What is the command used to view the system’s scheduled tasks list?

Option 1: crontab -l

Option 2: tasks

Option 3: cronlist

Option 4: schedulelist

Correct Answer: 1

Explanation: The “crontab -l” command is used to view the list of scheduled tasks (cron jobs) on the system. It lists the cron entries for the currently logged-in user. Scheduled tasks are used to automate various processes in a Linux system at specific times or intervals set by the user.

25. Question: To view the command history executed in the terminal, you would use the ____ command.

Option 1: history

Option 2: log

Option 3: list

Option 4: trace

Correct Answer: 1

Explanation: To view the command history executed in the terminal, you would use the “history” command. This command displays a list of previously executed commands, making it easy to rerun or recall commands used in the past.

Leave a Comment