Linux Quiz - MCQ - Multiple Choice Questions

Linux is an open-source operating system that has evolved into a cornerstone of the tech world. Whether you're stepping into the Linux environment for the first time or looking to solidify your foundational knowledge, this quiz will serve as an insightful learning resource. 

Dive in and test your understanding of the Linux operating system's fundamentals and commands with these 25 multiple-choice questions.

1. Which command is used to display the contents of a file?

A. show
B. display
C. print
D. cat

2. Which of the following is the Linux command to change directories?

A. chdir
B. move
C. cd
D. dirchg

3. What is the default shell in Linux?

A. bash
B. sh
C. ksh
D. csh

4. Which command will display the current working directory?

A. pwd
B. cwd
C. dir
D. list

5. How do you list the hidden files in a directory?

A. ls
B. ls -a
C. dir /hidden
D. ls -h

6. Which symbol represents the root directory in Linux?

A. /
B. \
C. ~
D. !

7. Which command is used to remove a directory?

A. rmdir
B. remove
C. del
D. delete

8. How do you print the first 10 lines of a file named 'file.txt'?

A. head -10 file.txt
B. first -10 file.txt
C. cat -10 file.txt
D. print -10 file.txt

9. Which command displays a file's type?

A. showtype
B. displaytype
C. cattype
D. file

10. What is the command to search for a pattern in a file?

A. search
B. find
C. grep
D. locate

11. Which command is used to see the running processes in Linux?

A. process
B. run
C. top
D. exec

12. What does the command chmod 777 filename do?

A. Changes the owner of the file
B. Deletes the file
C. Gives read, write, and execute permissions to everyone for that file
D. Hides the file

13. Which command is used to find files in a directory?

A. locate
B. search
C. find
D. list

14. How do you display the last ten lines of a file in Linux?

A. bottom
B. last
C. tail
D. end

15. Which command is used to create a symbolic link?

A. symb
B. link
C. ln
D. connect

16. How do you display your Linux system information?

A. info
B. uname -a
C. version
D. details

17. Which command is used to stop a process in Linux?

A. stop
B. halt
C. kill
D. terminate

18. What does the man command do?

A. Manages directories
B. Provides documentation or manual pages
C. Manages users
D. Monitors system performance

19. What command can replace characters in a file?

A. rep
B. change
C. sed
D. swap

20. Which command shows disk usage?

A. du
B. disk
C. space
D. usage

21. What is the primary role of the sudo command?

A. To run processes in the background
B. To provide manual pages for commands
C. To execute a command as another user, typically the superuser
D. To search for files in a directory

22. What is the purpose of the ls command?

A. To list the processes running on the system
B. To show the file size of a given file
C. To display the contents of a file
D. To list files in a directory

23. How do you search for a specific word within a file?

A. lookup
B. grep
C. seek
D. findword

24. If you want to repeat the last command in Linux, what would you type?

A. replay
B. !!
C. repeat
D. redo

25. How would you compress files using the Linux command line?

A. compress
B. minify
C. gzip
D. squeeze

26. Which command can you use to change the permissions of a file?

A. chown
B. chmod
C. chgroup
D. chperm

Comments

Spring Boot 3 Paid Course Published for Free
on my Java Guides YouTube Channel

Subscribe to my YouTube Channel (165K+ subscribers):
Java Guides Channel

Top 10 My Udemy Courses with Huge Discount:
Udemy Courses - Ramesh Fadatare