Q. Which command is used to view the contents of a compressed gzip file without decompressing it?

  • (A) zcat filename.gz
  • (B) cat filename.gz
  • (C) gzip -d filename.gz
  • (D) gunzip filename.gz
πŸ’¬ Discuss
βœ… Correct Answer: (A) zcat filename.gz
Explanation: 'zcat' displays compressed file contents without decompressing.

Q. What is the purpose of the 'chmod 755 filename' command?

  • (A) Sets read, write, execute for owner; read and execute for group and others
  • (B) Sets full permissions for everyone
  • (C) Removes all permissions
  • (D) Sets read and write permissions for owner only
πŸ’¬ Discuss
βœ… Correct Answer: (A) Sets read, write, execute for owner; read and execute for group and others
Explanation: '755' means rwx for owner, rx for group and others.

Q. What is the function of the 'uname -a' command?

  • (A) Displays system information including kernel version
  • (B) Shows disk usage
  • (C) Lists processes
  • (D) Displays network configuration
πŸ’¬ Discuss
βœ… Correct Answer: (A) Displays system information including kernel version
Explanation: 'uname -a' shows detailed system info.

Q. Which command is used to change a file's timestamp?

  • (A) touch
  • (B) date
  • (C) time
  • (D) chmod
πŸ’¬ Discuss
βœ… Correct Answer: (A) touch
Explanation: 'touch' updates access and modification times.

Q. Which of the following commands will display disk usage of a directory and its contents?

  • (A) du -sh directory
  • (B) df -h directory
  • (C) ls -lh directory
  • (D) free -h directory
πŸ’¬ Discuss
βœ… Correct Answer: (A) du -sh directory
Explanation: 'du -sh' shows total size of directory in human-readable form.

Q. Which command can be used to find the location of an executable file in the system PATH?

  • (A) which
  • (B) whereis
  • (C) locate
  • (D) find
πŸ’¬ Discuss
βœ… Correct Answer: (A) which
Explanation: 'which' shows the path of executables found in PATH.

Q. Which command will show current system uptime?

  • (A) uptime
  • (B) who
  • (C) top
  • (D) w
πŸ’¬ Discuss
βœ… Correct Answer: (A) uptime
Explanation: 'uptime' displays how long system has been running.

Q. How do you switch to the root user account in Linux?

  • (A) sudo su
  • (B) rootlogin
  • (C) switch root
  • (D) login root
πŸ’¬ Discuss
βœ… Correct Answer: (A) sudo su
Explanation: 'sudo su' elevates to root shell.

Q. Which file contains the list of user groups?

  • (A) /etc/group
  • (B) /etc/passwd
  • (C) /etc/shadow
  • (D) /etc/gshadow
πŸ’¬ Discuss
βœ… Correct Answer: (A) /etc/group
Explanation: /etc/group stores group information.

Q. What does the 'mount' command do?

  • (A) Attaches a filesystem to a directory
  • (B) Displays mounted filesystems
  • (C) Detaches a filesystem
  • (D) Formats a disk
πŸ’¬ Discuss
βœ… Correct Answer: (A) Attaches a filesystem to a directory
Explanation: 'mount' connects storage devices to filesystem hierarchy.