Font size
WorksheetsFinal_quiz
Total questions: 97
Worksheet time: 50mins
In the command “echo -n hello”, what is “echo”
argument
command
option
switch
In the command echo Welcome, what does the word Welcome represent with respect to the command?
argument
command
flag
switch
Which of the following command can be used to remove the link?
user can’t remove
rm
delete
pwd
Linux default shell is
BAH shell
SH shell
ASH shell
BASH shell
Help for all commands is available at
Man command
Help command
Join command
Tput command
The complete path name of a file or directory is
Root name
Tree name
Relative path name
Absolute path name
What is a regular file in Linux?
a) A file that stores data such as text, binaries, and media
b) A container for organizing other files
c) A type of device file used for hardware communication
d) A shortcut to another file
How can you identify a regular file using the ls -l command?
a) It is marked with a d in the first column
b) It is marked with a - in the first column
c) It is marked with a c in the first column
d) It is marked with a b in the first column
What is a directory in Linux?
a) A file used for inter-process communication
b) A file used to store character data
c) A container for organizing files and directories
d) A shortcut to another file
What is the primary role of the root (super user) in Linux?
a) Managing services like SSH and mail
b) Performing day-to-day tasks for regular users
c) Full system administration with unrestricted access
d) Running background tasks like logging
How is the root user typically identified in Linux?
a) By the prompt $
b) By the username daemon
c) By the prompt #
d) By the home directory /home/root
Which of the following is an example of a system user?
a) john
b) mail
c) root
d) developer
What happens if a regular user tries to modify system files without sudo?
a) The modification is successful.
b) The system warns about insufficient permissions.
c) The user automatically gains root privileges.
d) The file is deleted.
Which command can be used to switch to the root user?
a) sudo
b) su
c) Both sudo and su
d) useradd
What are the three basic types of permissions in Unix/Linux?
a) Read, Write, Execute
b) Owner, Group, Others
c) User, Group, World
d) Read, Write, Delete
Which command is used to display the current working directory?
a) ls
b) pwd
c) cd
d) mkdir
How can you identify a regular file using the ls -l command?
a) It is marked with a d in the first column
b) It is marked with a - in the first column
c) It is marked with a c in the first column
d) It is marked with a b in the first column
Which command can be used to switch to the root user?
a) sudo
b) su
c) Both sudo and su
d) useradd
What is the first step before detaching a disk from an Azure VM?
a) Stop the target VM
b) Format the disk
c) Unmount the disk
d) Delete the disk from Azure
Which command is used to unmount a disk in Linux?
a) umount
b) detach
c) disk-remove
d) mount-off
What should be done after attaching a disk to a new VM to use it?
a) Stop the VM
b) Unmount the disk
c) Format the disk
d) delete the disk
What happens if you do not unmount a disk before detaching it in Azure?
a) The VM will crash.
b) The disk will be formatted automatically.
c) Data might get corrupted.
d) The disk cannot be detached.
Which option in the useradd command ensures a home directory is created for the new user?
a) -s
b) -d
c) -m
d) -u
What is the primary purpose of the passwd command?
a) To create a user
b) To delete a user
c) To set or change a user's password
d) To list user details
When you execute sudo passwd alice, what happens?
a) The user alice is deleted.
b) You are prompted to set or update the password for the user alice.
c) The user alice is added to a group.
d) The home directory of alice is updated.
What is the purpose of the groupadd command?
a) To add a user to a group
b) To delete a group
c) To create a new group
d) To view group membership
What does the -aG option in the usermod command do?
a) Adds the user to a specified group and retains existing groups.
b) Deletes the user from the specified group.
c) Assigns a new shell for the user.
d) Changes the user's home directory.
Which chmod value gives read, write, and execute permissions to the owner and group, but no permissions to others?
a) 777
b) 755
c) 770
d) 700
What does the command sudo chown alice:developers file.txt do?
a) Changes the file's group to alice and owner to developers.
b) Changes the file's owner to alice and group to developers.
c) Changes the file's permissions to 770.
d) Deletes the file file.txt.
Which of the following is the correct sequence to create a user, add them to a group, and set up file ownership?
a) useradd -> passwd -> chgrp -> chmod
b) useradd -> passwd -> usermod -> chown
c) groupadd -> userdel -> chown -> chmod
d) passwd -> usermod -> chown -> chmod
Which command is used to archive multiple files into a single uncompressed file?
a) gzip
b) tar
c) bzip2
d) xz
What is the file extension for files compressed using bzip2?
a) .gz
b) .bz2
c) .xz
d) .tar
Which command decompresses a .xz file?
a) xz file.xz
b) xz -d file.xz
c) tar -Jvf file.xz
d) gzip -d file.xz
Which of the following is true about a primary partition?
a) It can contain multiple logical partitions.
b) It is used to install and boot the operating system.
c) Only one primary partition can exist on a hard disk.
d) It cannot be marked as active.
What is the maximum disk size supported by MBR?
a) 1 TB
b) 2 TB
c) 4 TB
d) Unlimited
Which of the following is a feature of GPT?
a) Supports only 4 partitions.
b) Compatible only with BIOS.
c) Allows disks larger than 2 TB.
d) Does not support backup partition tables.
What does the r permission allow in rwx?
a) Executing a file
b) Reading a file's contents
c) Writing to a file
d) Changing file ownership
What does the ls -l command display?
a) File size only
b) File permissions, ownership, and metadata
c) File extensions only
d) All files in a directory
What do the three permission categories (user, group, others) represent?
a) File type, file size, and file name
b) File owner, group owner, and everyone else
c) Permissions for system users only
d) Hidden, read-only, and executable
What numerical value corresponds to rw- permissions?
a) 7
b) 6
c) 5
d) 4
What is the purpose of system users in Linux?
a) For regular users to log in and perform tasks
b) To provide specific services like ssh or mail
c) To create and delete files
d) To manage sudo privileges
What is the default UID range for regular users in Linux?
a) 0–100
b) 1–999
c) 1000 and above
d) No specific range
Which user type has unrestricted access to all files and commands in Linux?
a) Regular user
b) System user
c) Superuser (root)
d) Group owner
Who is the creator of the Linux kernel?
a) Dennis Ritchie
b) Ken Thompson
c) Linus Torvalds
d) Richard Stallman
What is the primary difference between Unix and Linux?
a) Linux is proprietary, while Unix is open-source.
b) Linux is open-source, while Unix is proprietary.
c) Both are open-source.
d) Both are proprietary.
What is the role of the kernel in an operating system?
a) To manage system hardware and software resources.
b) To provide a user interface for interacting with the OS.
c) To handle only file system management.
d) To manage web applications.
What is a shell in an operating system?
a) The hardware interface of a computer.
b) A graphical program that replaces the kernel.
c) A program that interprets user commands and communicates with the kernel.
d) A web browser tool.
How is the root user typically identified in Linux?
a) By the prompt $
b) By the username daemon
c) By the prompt #
d) By the home directory /home/root
What is a shell in an operating system?
a) The hardware interface of a computer.
b) A graphical program that replaces the kernel.
c) A program that interprets user commands and communicates with the kernel.
d) A web browser tool.
What is the role of the kernel in an operating system?
a) To manage system hardware and software resources.
b) To provide a user interface for interacting with the OS.
c) To handle only file system management.
d) To manage web applications.
What is the default UID range for regular users in Linux?
a) 0–100
b) 1–999
c) 1000 and above
d) No specific range
Which of the following is true about a primary partition?
a) It can contain multiple logical partitions.
b) It is used to install and boot the operating system.
c) Only one primary partition can exist on a hard disk.
d) It cannot be marked as active.
Which of the following is the correct sequence to create a user, add them to a group, and set up file ownership?
a) useradd -> passwd -> chgrp -> chmod
b) useradd -> passwd -> usermod -> chown
c) groupadd -> userdel -> chown -> chmod
d) passwd -> usermod -> chown -> chmod
Which chmod value gives read, write, and execute permissions to the owner and group, but no permissions to others?
a) 777
b) 755
c) 770
d) 700
What does the -aG option in the usermod command do?
a) Adds the user to a specified group and retains existing groups.
b) Deletes the user from the specified group.
c) Assigns a new shell for the user.
d) Changes the user's home directory.
What is the primary purpose of the passwd command?
a) To create a user
b) To delete a user
c) To set or change a user's password
d) To list user details
What is the purpose of the systemctl get-default command?
a) To check the status of all services
b) To display the default target (runlevel) of the system
c) To list all running processes
d) To restart the system
How can you change the default system target to multi-user mode?
a) sudo systemctl default multi-user.target
b) sudo systemctl set-default multi-user.target
c) sudo systemctl change multi-user.target
d) sudo systemctl reset multi-user.target
Which command is used to restart a systemd service?
a) systemctl reboot <service>
b) systemctl reload <service>
c) systemctl restart <service>
d) systemctl enable <service>
What does sudo systemctl enable apache2 do?
a) Starts the Apache2 service immediately
b) Enables the Apache2 service to start on boot
c) Stops the Apache2 service
d) Disables the Apache2 service
What is the primary purpose of the crontab command in Linux?
A) To execute a command immediately
B) To schedule repetitive tasks at specific times
C) To monitor system performance
D) To install software packages
What does * * * * * mean in a crontab entry?
A) Runs every second
B) Runs every hour
C) Runs every minute
D) Runs every day at midnight
Which command lists all scheduled cron jobs for the current user?
A) cron -l
B) list-cron
C) crontab -l
D) crontab --show
What does the at command do in Linux?
A) Schedules a task to run at a specific future time
B) Runs a command every minute
C) Displays system logs
D) Monitors active processes
How do you schedule a job to run in 10 minutes using at?
A) at +10 minutes "command"
B) echo "command" | at now + 10 minutes
C) schedule 10m command
D) crontab -e 10m command
How can you list all pending at jobs?
A) atq
B) at -l
C) jobs -a
D) queue -at
What does this crontab entry do?
0 0 1 * * /sbin/reboot
A) Reboots the system daily at midnight
B) Reboots the system on the first day of every month at midnight
C) Reboots the system every Sunday at midnight
D) Never executes
Which package manager is used in Debian and Ubuntu-based distributions?
A) dnf
B) pacman
C) apt
D) zypper
What does the following command do?
sudo apt update && sudo apt upgrade -y
A) Removes all installed packages
B) Updates the package list and upgrades installed packages
C) Installs a new package
D) Deletes unused dependencies
How can you remove a package in Ubuntu?
A) apt remove <package_name>
B) dnf uninstall <package_name>
C) rpm -e <package_name>
D) pacman -R <package_name>
What is a process in Linux?
a) A collection of files stored in the system
b) A running instance of a program
c) A command stored in the shell history
d) A type of kernel module
What is a zombie process in Linux?
a) A process that is running in the background
b) A process that has completed execution but still has an entry in the process table
c) A process that consumes all system resources
d) A process that cannot be terminated
Which command lists all background jobs in the current shell?
a) jobs
b) list
c) bg
d) top
What is the difference between a foreground and a background process in Linux?
a) A foreground process runs in the terminal, while a background process runs in the background
b) A background process cannot be stopped
c) Foreground processes use more CPU than background processes
d) There is no difference
What is the parent process of all processes in a Linux system?
a) init or systemd
b) bash
c) kernel
d) cron
Which command updates the package index in Ubuntu?
A) sudo apt upgrade
B) sudo apt update
C) sudo apt install
D) sudo apt remove
What does the apt install command do in Linux?
A) Updates all installed packages
B) Downloads and installs a new package
C) Removes a package from the system
D) Displays package details
Which Linux distribution uses the dnf package manager?
A) Ubuntu
B) Debian
C) Fedora
D) Arch Linux
Which command lists installed packages in Ubuntu?
A) dnf list installed
B) apt list --installed
C) pacman -Q
D) zypper lr
What command installs Apache2 on Ubuntu?
A) sudo apt install apache2
B) sudo yum install apache2
C) sudo pacman -S apache2
D) sudo zypper install apache2
What is the purpose of sudo systemctl enable apache2?
A) Start Apache2 immediately
B) Make Apache2 start automatically on boot
C) Restart Apache2
D) Uninstall Apache2
Which command is used to check the IP address of your Linux machine?
A) netstat -rn
B) ip a
C) ping
D) traceroute
What is the purpose of DNS?
A) Assign IP addresses dynamically
B) Convert domain names to IP addresses
C) Block unauthorized network access
D) Establish a VPN connection
What is the default port for SSH?
A) 22
B) 80
C) 443
D) 53
Which command checks if firewalld is running?
A) firewalld --status
B) sudo systemctl status firewalld
C) firewalld --reload
D) sudo firewall-cmd --get-zones
What does #!/bin/bash at the start of a script indicate?
A) It specifies the location of the script
B) It defines the default shell for execution
C) It comments out the first line of the script
D) It sets the script to execute in the background
Which command is used to display disk usage in Linux?
A) ls -l
B) df -h
C) top
D) free -m
What is the purpose of the nmcli command in Linux?
a) Manage network connections
b) Monitor CPU usage
c) List running processes
d) Configure firewall settings
Which nmcli command is used to display available Wi-Fi networks?
a) nmcli connection show
b) nmcli device wifi list
c) nmcli radio wifi
d) nmcli general status
What is the primary purpose of the ping command?
a) Transfer files between servers
b) Test network connectivity
c) Display system logs
d) Monitor CPU performance
What is the nslookup command used for?
a) To look up network processes
b) To check disk space
c) To query DNS records
d) To analyze network speed
How can you use nslookup to find the IP address of a domain (e.g., google.com)?
a) nslookup google.com
b) nslookup -ip google.com
c) nslookup --resolve google.com
d) nslookup -dns google.com
What does the ssh command do?
a) Securely logs into a remote system
b) Copies files between directories
c) Checks disk space usage
d) Lists open ports
What is the purpose of the scp command?
a) Securely copy files between systems
b) Securely compress files
c) Display system logs
d) Scan open ports
Which command correctly copies file.txt from a local system to a remote server?
a) scp file.txt user@server:/home/user/
b) scp user@server:/home/user/ file.txt
c) scp file.txt /home/user/ user@server
d) scp -copy file.txt user@server:/home/user/
