Q. Which command is used to switch to another user account?

  • (A) su - username
  • (B) login username
  • (C) switch username
  • (D) changeuser username
πŸ’¬ Discuss
βœ… Correct Answer: (A) su - username
Explanation: 'su -' switches user shell.

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

  • (A) Change user password
  • (B) Create a new user
  • (C) Delete a user
  • (D) Lock a user account
πŸ’¬ Discuss
βœ… Correct Answer: (A) Change user password
Explanation: 'passwd' allows users to change their passwords.

Q. Which command is used to display the kernel version in Linux?

  • (A) linux --version
  • (B) uname -r
  • (C) version
  • (D) kernel -v
πŸ’¬ Discuss
βœ… Correct Answer: (B) uname -r
Explanation: 'uname -r' prints the kernel release version of the Linux system.

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

  • (A) df
  • (B) diskcheck
  • (C) du
  • (D) usage
πŸ’¬ Discuss
βœ… Correct Answer: (C) du
Explanation: 'du' stands for disk usage and shows the size of directories and files.

Q. Which command can be used to create an empty file in Linux?

  • (A) touch
  • (B) makefile
  • (C) create
  • (D) echo
πŸ’¬ Discuss
βœ… Correct Answer: (A) touch
Explanation: 'touch filename' creates a new empty file or updates the timestamp if it already exists.

Q. Which command is used to print the current user ID and group ID?

  • (A) whoami
  • (B) id
  • (C) userinfo
  • (D) who
πŸ’¬ Discuss
βœ… Correct Answer: (B) id
Explanation: 'id' prints user ID (UID), group ID (GID), and the groups you belong to.

Q. What does the command 'ls -lh' do?

  • (A) Lists hidden files only
  • (B) Lists all files with human-readable sizes
  • (C) Lists file contents
  • (D) Locks hidden files
πŸ’¬ Discuss
βœ… Correct Answer: (B) Lists all files with human-readable sizes
Explanation: 'ls -lh' lists files with details and sizes in a human-readable format like KB, MB.

Q. Which of these is a valid runlevel for reboot?

  • (A) 3
  • (B) 5
  • (C) 1
  • (D) 6
πŸ’¬ Discuss
βœ… Correct Answer: (D) 6
Explanation: Runlevel 6 is used to reboot the system in SysV-style init systems.

Q. Which command shows the path of a command's executable?

  • (A) location
  • (B) path
  • (C) which
  • (D) where
πŸ’¬ Discuss
βœ… Correct Answer: (C) which
Explanation: 'which' shows the path of an executable as stored in the $PATH variable.

Q. Which command lists all files and subdirectories recursively?

  • (A) ls -R
  • (B) ls -l
  • (C) ls -a
  • (D) ls -d
πŸ’¬ Discuss
βœ… Correct Answer: (A) ls -R
Explanation: 'ls -R' recursively lists all files and directories starting from the current directory.