Q. Which command displays the IP address of the system?

  • (A) ip addr
  • (B) ifconfig
  • (C) hostname -I
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above
Explanation: All can be used to display IP addresses, though 'ifconfig' is deprecated.

Q. What is the use of the 'sudo' command?

  • (A) Run commands with elevated privileges
  • (B) Switch user
  • (C) Schedule tasks
  • (D) Stop a process
πŸ’¬ Discuss
βœ… Correct Answer: (A) Run commands with elevated privileges
Explanation: 'sudo' allows running commands as root or another user.

Q. Which command shows disk partitions and their sizes?

  • (A) fdisk -l
  • (B) df -h
  • (C) lsblk
  • (D) mount
πŸ’¬ Discuss
βœ… Correct Answer: (A) fdisk -l
Explanation: 'fdisk -l' lists partition tables.

Q. What does the 'uname -r' command display?

  • (A) Kernel version
  • (B) Release date
  • (C) Hostname
  • (D) Processor type
πŸ’¬ Discuss
βœ… Correct Answer: (A) Kernel version
Explanation: 'uname -r' shows the Linux kernel version.

Q. Which command is used to display the contents of a file page by page?

  • (A) less filename
  • (B) more filename
  • (C) Both less and more
  • (D) cat filename
πŸ’¬ Discuss
βœ… Correct Answer: (C) Both less and more
Explanation: 'less' and 'more' display file contents page-wise.

Q. Which command is used to remove a directory and its contents?

  • (A) rm -r directory
  • (B) rmdir directory
  • (C) del directory
  • (D) remove directory
πŸ’¬ Discuss
βœ… Correct Answer: (A) rm -r directory
Explanation: 'rm -r' removes directory recursively.

Q. How do you display the contents of a compressed tar archive?

  • (A) tar -tvf archive.tar.gz
  • (B) tar -xvf archive.tar.gz
  • (C) tar -cvf archive.tar.gz
  • (D) gzip -l archive.tar.gz
πŸ’¬ Discuss
βœ… Correct Answer: (A) tar -tvf archive.tar.gz
Explanation: 'tar -tvf' lists contents without extracting.

Q. Which command is used to see the environment variables of the current shell?

  • (A) printenv
  • (B) env
  • (C) set
  • (D) All of the above
πŸ’¬ Discuss
βœ… Correct Answer: (D) All of the above
Explanation: All commands can display environment variables.

Q. Which file controls the shell startup configuration for a user?

  • (A) ~/.bashrc
  • (B) /etc/passwd
  • (C) ~/.profile
  • (D) Both ~/.bashrc and ~/.profile
πŸ’¬ Discuss
βœ… Correct Answer: (D) Both ~/.bashrc and ~/.profile
Explanation: Both files influence shell startup behavior.

Q. Which command shows the last login details of users?

  • (A) last
  • (B) who
  • (C) w
  • (D) users
πŸ’¬ Discuss
βœ… Correct Answer: (A) last
Explanation: 'last' shows login history.