Unix Quiz - Multiple Choice Questions (MCQ)

Welcome to the UNIX Quiz! This quiz provides 25 Multiple Choice Questions (MCQ) covering a broad overview of the fundamental concepts and commands associated with the UNIX operating system. It is crucial for professionals and students to familiarize themselves with these basics for efficient use of UNIX and its various distributions. Dive into the quiz!

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

a) cat
b) show
c) display
d) type

2. Which Unix command is used to count the number of lines, words, and characters in a file?

a) count
b) wc
c) calc
d) measure

3. What does the grep command do?

a) Finds a file by name
b) Searches inside a file for a string
c) Replaces strings in a file
d) Lists all files in a directory

4. What is the purpose of the chmod command?

a) Modify file ownership
b) Modify file permissions
c) Change file type
d) Move a file to a different directory

5. Which of the following commands is used to remove a directory?

a) rmdir
b) del
c) remove
d) delete

6. The pwd command in UNIX is used for:

a) Printing all directories
b) Printing current directory
c) Changing to the home directory
d) Changing directory permissions

7. Which command will display all hidden files in a directory?

a) ls -a
b) ls -h
c) ls -d
d) ls -s

8. What does the >> operator do in UNIX?

a) Redirects error messages
b) Appends output to a file
c) Overwrites file content
d) Compares two files

9. Which Unix command displays the manual or help pages of a command?

a) man
b) help
c) info
d) guide

10. Which Unix command is used to display the process status?

a) ps
b) stat
c) view
d) proc

11. What does the kill command do in UNIX?

a) Deletes a file
b) Ends a user session
c) Stops a running process
d) Displays user activity

12. Which Unix command can be used to display disk usage?

a) du
b) disk
c) usage
d) space

13. The which command in UNIX is used to:

a) Determine the type of a file
b) Search for a command's binary location
c) Search for files containing a specific string
d) Display users logged into the system

14. The alias command in UNIX is used for:

a) Renaming a file or directory
b) Creating a shortcut for a command
c) Displaying file permissions
d) Listing all available commands

15. Which of the following commands will display the last 100 lines of a file named "data.txt"?

a) tail -n 100 data.txt
b) head -n 100 data.txt
c) cat 100 data.txt
d) print -l 100 data.txt

16. What is the primary purpose of the crontab command?

a) Schedule tasks to run at specific intervals
b) Display system's uptime
c) Show system cron logs
d) List files in the current directory

17. Which of the following commands is used to sort the contents of a file?

a) order
b) arrange
c) sort
d) classify

18. Which command allows you to substitute a string in a file?

a) replace
b) alter
c) sed
d) swap

19. Which command is used to find the location of a program in UNIX?

a) find
b) locate
c) where
d) which

20. Which command is used to send the output of one command as the input to another command?

a) >>
b) |
c) >
d) <<

21. What does the chown command do?

a) Change the name of a file or directory
b) Change the permissions of a file or directory
c) Change the owner of a file or directory
d) Check for file ownership

22. The ln command in UNIX is used to:

a) List file names
b) Link files
c) Log in to the system
d) List network connections

23. Which command is used to repeat the last executed command in UNIX?

a) redo
b) !!
c) repeat
d) ^

24. What does the $? variable signify in UNIX?

a) Total number of arguments
b) Process ID of the last command
c) Exit status of the last command
d) Current user ID

25. The touch command in UNIX is primarily used to:

a) Touch files or directories
b) Display file content
c) Modify file timestamps
d) Change file permissions

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