Chapter 8: Unix and Linux Operating Systems (Set-4)

In Linux file management, which command safely removes a directory and all its contents recursively

A rm -r
B rmdir -r
C deltree now
D erase all

Which command asks for confirmation before each file removal, reducing accidental deletes

A rm -f
B rm -R
C rm -i
D rm -a

In Linux, which rm option forces deletion without prompts, even if files are write-protected

A rm -i
B rm -v
C rm -d
D rm -f

When copying directories with all subfolders in Linux, which option is commonly required

A cp -i
B cp -r
C cp -u
D cp -t

Which cp option preserves file timestamps and permissions during copying

A cp -r
B cp -f
C cp -p
D cp -d

In a Linux pipeline, which stream is normally sent through the pipe by default

A Standard error
B Keyboard input
C Kernel output
D Standard output

Which redirection sends error messages into a file instead of showing them on screen

A > redirect
B < redirect
C 2> redirect
D | redirect

Which redirection combines standard output and standard error into the same file in Bash

A 2> file
B &> file
C > file
D < file

In Linux permission bits, which special bit on a directory enables shared-file collaboration safely

A SUID bit
B SGID bit
C Exec bit
D Sticky bit

Which special permission bit runs an executable with the file owner’s privileges

A Sticky bit
B Read bit
C SUID bit
D SGID bit

Which special permission bit on a directory makes new files inherit the directory’s group

A SGID bit
B SUID bit
C Sticky bit
D Umask bit

Which command changes default file creation permissions by modifying a mask value

A chmod command
B chown command
C groups command
D umask command

In numeric permission calculation, what does digit “7” represent for one class

A rw- permissions
B r-x permissions
C rwx permissions
D r– permissions

For a regular file, which permission is required to run it as a program

A Execute permission
B Write permission
C Group membership
D Sticky bit

Which command shows numeric and symbolic permissions along with file details

A cat command
B echo command
C stat command
D time command

Which command shows disk usage of a directory in human-readable form

A df -h
B du -sh
C ls -lh
D free -h

Which df option displays filesystem sizes in human-readable units like GB and MB

A df -i
B df -t
C df -p
D df -h

When storage issues happen, which df option helps check inode exhaustion

A df -h
B df -a
C df -i
D df -r

Which command prints the current shell’s process ID, useful in scripting

A echo $?
B echo
C echo $0
D echo $!

Which Bash variable stores the PID of the most recent background process

A echo $$
B echo $?
C echo $1
D echo $!

In Linux text processing, which operator anchors a pattern to the start of a line in grep

A ^ symbol
B $ symbol
C * symbol
D | symbol

Which regex symbol anchors a pattern to the end of a line in grep

A ^ symbol
B ? symbol
C $ symbol
D + symbol

Which grep option ignores letter case, matching both upper and lower case

A grep -n
B grep -v
C grep -r
D grep -i

Which grep option shows line numbers along with matching lines

A grep -i
B grep -n
C grep -c
D grep -l

Which command displays the current working directory of a specific process by PID

A pwd process
B cd /proc
C ls /proc/PID/cwd
D pgrep cwd

Which /proc file shows command-line arguments used to start a specific process

A /proc/PID/cmdline
B /proc/PID/status
C /proc/PID/meminfo
D /proc/PID/uptime

Which /proc file commonly summarizes process state, UID, and memory details

A /proc/PID/maps
B /proc/PID/environ
C /proc/PID/fdinfo
D /proc/PID/status

Which command changes ownership recursively for an entire directory tree

A chmod -R
B chgrp -R
C chown -R
D usermod -R

Which command changes permissions recursively for all files under a directory

A chown -R
B chmod -R
C chgrp -R
D passwd -R

Which command locks a user account by disabling password-based login

A useradd -l
B chmod -l
C chown -l
D passwd -l

Which command unlocks a previously locked user account for password login

A passwd -r
B usermod -u
C passwd -u
D chage -u

Which command changes the default login shell assigned to a user account

A chsh command
B chmod command
C chown command
D chgrp command

Which file lists valid login shells allowed for user accounts on many systems

A /etc/profile
B /etc/hosts
C /etc/fstab
D /etc/shells

Which file is commonly executed for system-wide environment settings for login shells

A /etc/fstab
B /etc/group
C /etc/profile
D /etc/exports

Which command reloads systemd manager configuration after editing unit files

A systemctl daemon-reload
B systemctl restart
C systemctl enable
D systemctl isolate

Which command restarts a service to apply new configuration immediately

A systemctl stop
B systemctl enable
C systemctl restart
D systemctl mask

Which command reloads configuration without fully stopping a supported service

A systemctl restart
B systemctl enable
C systemctl disable
D systemctl reload

Which networking command tests if a specific TCP port is reachable on a remote host

A du command
B nc command
C tar command
D ln command

Which command lists open network sockets and listening ports on many Linux systems

A ls command
B cd command
C ss command
D wc command

Which older command often used to show listening ports has been replaced by ss in many distros

A who command
B chsh command
C mount command
D netstat command

Which command checks DNS resolution by querying specific DNS servers and records

A dig command
B ps command
C df command
D rm command

Which command shows active system processes with CPU and memory in real-time, but can be more user-friendly than top

A pwd command
B htop tool
C tee command
D cat command

Which file permission practice is safest for private SSH keys in a user’s home directory

A 644 permission
B 755 permission
C 777 permission
D 600 permission

Which directory typically stores user SSH configuration and keys

A /etc/ssh folder
B /var/ssh folder
C ~/.ssh folder
D /tmp/ssh folder

Which file in ~/.ssh allows public keys to authenticate without passwords

A known_hosts file
B authorized_keys file
C shadow file
D hosts file

Which file in ~/.ssh stores fingerprints of previously connected SSH hosts

A authorized_keys file
B passwd file
C known_hosts file
D group file

Which command verifies integrity of a downloaded file by comparing a checksum value

A chmod command
B mkdir command
C ps command
D sha256sum command

In Linux archives, which command lists contents of a tar archive without extracting

A tar -t
B tar -x
C tar -c
D tar -p

Which tar option extracts files from an archive to the filesystem

A tar -c
B tar -t
C tar -x
D tar -p

Which command displays a Linux system’s current runlevel-style target on systemd systems

A systemctl status
B systemctl list
C systemctl enable
D systemctl get-default

Leave a Reply

Your email address will not be published. Required fields are marked *