Q. Which command will display the CPU architecture?

  • (A) cpuinfo
  • (B) arch
  • (C) lscpu
  • (D) uname -m
πŸ’¬ Discuss
βœ… Correct Answer: (D) uname -m
Explanation: 'uname -m' shows the machine hardware name, which reflects CPU architecture.

Q. Which of the following commands is used to delete a directory in Linux?

  • (A) rmdir
  • (B) rm -d
  • (C) delete
  • (D) dirrm
πŸ’¬ Discuss
βœ… Correct Answer: (A) rmdir
Explanation: 'rmdir' deletes empty directories. Use 'rm -r' for non-empty ones.

Q. Which Linux command shows the number of lines, words, and characters in a file?

  • (A) count
  • (B) stats
  • (C) wc
  • (D) lines
πŸ’¬ Discuss
βœ… Correct Answer: (C) wc
Explanation: 'wc' (word count) returns the number of lines, words, and bytes/characters in a file.

Q. Which command is used to extract `.tar.gz` files?

  • (A) tar -xvzf file.tar.gz
  • (B) unzip file.tar.gz
  • (C) gzextract file.tar.gz
  • (D) untar file.tar.gz
πŸ’¬ Discuss
βœ… Correct Answer: (A) tar -xvzf file.tar.gz
Explanation: 'tar -xvzf' extracts gzip-compressed tarball archives.

Q. Which Linux command shows a file one page at a time?

  • (A) cat
  • (B) more
  • (C) show
  • (D) view
πŸ’¬ Discuss
βœ… Correct Answer: (B) more
Explanation: 'more' displays output one screen at a time, useful for reading large files.

Q. Which command in Linux is used to search for a string inside a file?

  • (A) find
  • (B) search
  • (C) grep
  • (D) locate
πŸ’¬ Discuss
βœ… Correct Answer: (C) grep
Explanation: 'grep' is used to search for patterns (strings) in files using regular expressions.

Q. Which command is used to count the number of lines in a file?

  • (A) cat
  • (B) count
  • (C) wc -l
  • (D) lines
πŸ’¬ Discuss
βœ… Correct Answer: (C) wc -l
Explanation: 'wc -l' counts the number of lines in a file.

Q. Which command is used to remove non-empty directories?

  • (A) rmdir
  • (B) rm -r
  • (C) deletedir
  • (D) rmd
πŸ’¬ Discuss
βœ… Correct Answer: (B) rm -r
Explanation: 'rm -r' removes directories and their contents recursively.

Q. Which command is used to display active internet connections?

  • (A) ip link
  • (B) netstat
  • (C) lsof
  • (D) ping
πŸ’¬ Discuss
βœ… Correct Answer: (B) netstat
Explanation: 'netstat' displays active network connections, listening ports, and more.

Q. Which file is used to define scheduled cron jobs?

  • (A) /etc/schedule
  • (B) /etc/cron
  • (C) /etc/crontab
  • (D) /var/cronjobs
πŸ’¬ Discuss
βœ… Correct Answer: (C) /etc/crontab
Explanation: '/etc/crontab' is used to define system-wide cron jobs.