UNIX Question and Answer – File System Administration
UNIX MCQ – Multiple Choice Questions for exam, interview, and Entrance Test
1. Which command is used to display the disk usage of each file and directory in UNIX, with a specified maximum depth of recursion?
a) du -r
b) du -d
c) du -m
d) du -l
Answer: b) du -d
Explanation: The du command with the -d option displays the disk usage of each file and directory in UNIX with a specified maximum depth of recursion.
2. What is the purpose of the -e option in the quotaoff command?
a) Disable quotas for a specific user
b) Exclude specific files
c) Enable quotas for all users
d) Exclude specific file systems
Answer: d) Exclude specific file systems
Explanation: The -e option of the quotaoff command is used to exclude specific file systems from quotas in UNIX.
3. Which command is used to display disk usage for a specific user and file system type in UNIX?
a) userdu
b) duuser
c) du -u
d) du -user
Answer: c) du -u
Explanation: The du command with the -u option is used to display disk usage for a specific user and file system type in UNIX.
4. What is the purpose of the -j option in the quotacheck command?
a) Specify quota file location
b) Perform a quick check
c) Display quota usage
d) Generate report in JSON format
Answer: d) Generate report in JSON format
Explanation: The -j option of the quotacheck command is used to generate a report in JSON format in UNIX.
5. Which command is used to set disk quotas for a specific group and file system in UNIX?
a) groupquota
b) setquota
c) edquota
d) quotaon
Answer: a) groupquota
Explanation: The groupquota command is used to set disk quotas for a specific group and file system in UNIX.
6. What is the purpose of the -M option in the du command?
a) Display usage in megabytes
b) Display usage in human-readable format
c) Display usage for remote file systems
d) Do not cross file system boundaries
Answer: d) Do not cross file system boundaries
Explanation: The -M option of the du command is used to prevent crossing file system boundaries in UNIX.
7. Which command is used to display disk usage for a specific file system type and file in UNIX?
a) fsdu
b) fsusage
c) du -fs
d) du -file
Answer: c) du -fs
Explanation: The du command with the -fs option is used to display disk usage for a specific file system type and file in UNIX.
8. What is the purpose of the -s option in the quotaoff command?
a) Disable quotas for a specific user
b) Disable quotas for all users
c) Specify quota file location
d) Display summary information
Answer: b) Disable quotas for all users
Explanation: The -s option of the quotaoff command is used to disable quotas for all users in UNIX.
9. Which command is used to display disk usage for a specific group and file system type in UNIX?
a) groupdu
b) gdu
c) du -g
d) du -group
Answer: c) du -g
Explanation: The du command with the -g option is used to display disk usage for a specific group and file system type in UNIX.
10. What is the purpose of the -F option in the quotacheck command?
a) Perform a fast check
b) Perform a verbose check
c) Specify quota file location
d) Display quota usage
Answer: a) Perform a fast check
Explanation: The -F option of the quotacheck command is used to perform a fast check in UNIX.
11. Which command is used to display the disk usage of a specific directory and its subdirectories in UNIX, while displaying the sizes in human-readable format?
a) du -h
b) du -s
c) du -S
d) du -k
Answer: a) du -h
Explanation: The du command with the -h option displays the disk usage of a specific directory and its subdirectories in UNIX, showing sizes in human-readable format.
12. What is the purpose of the -u option in the df command?
a) Display usage for mounted file systems
b) Display usage in human-readable format
c) Display usage for specific users
d) Display usage for remote file systems
Answer: c) Display usage for specific users
Explanation: The -u option of the df command is used to display disk usage for specific users in UNIX.
13. Which command is used to display the disk usage statistics for the specified directory and its subdirectories in UNIX, while displaying the grand total at the end?
a) du -h
b) du -s
c) du -S
d) du -c
Answer: d) du -c
Explanation: The du command with the -c option displays the disk usage statistics for the specified directory and its subdirectories in UNIX, showing the grand total at the end.
14. What is the purpose of the -i option in the df command?
a) Display usage in human-readable format
b) Display usage for mounted file systems
c) Display the number of inodes used and available
d) Display usage in kilobytes
Answer: c) Display the number of inodes used and available
Explanation: The -i option of the df command is used to display the number of inodes used and available on a file system in UNIX.
15. Which command is used to display disk usage for a specific user and directory in UNIX?
a) userdu
b) du -user
c) du -u
d) du -udir
Answer: c) du -u
Explanation: The du command with the -u option is used to display disk usage for a specific user and directory in UNIX.
16. What is the purpose of the -r option in the df command?
a) Display usage for remote file systems
b) Display usage for mounted file systems
c) Display file system type
d) Display usage in human-readable format
Answer: b) Display usage for mounted file systems
Explanation: The -r option of the df command is used to display disk usage for mounted file systems in UNIX.
17. Which command is used to display the disk usage statistics for the specified directory and its subdirectories in UNIX, sorted by size?
a) du -h
b) du -s
c) du -S
d) du -k
Answer: c) du -S
Explanation: The du command with the -S option displays the disk usage statistics for the specified directory and its subdirectories in UNIX, sorted by size.
18. What is the purpose of the -l option in the df command?
a) Display usage for remote file systems
b) Display total disk usage
c) Display usage in human-readable format
d) Display usage for specific users
Answer: b) Display total disk usage
Explanation: The -l option of the df command is used to display the total disk usage in UNIX.
19. Which command is used to display disk usage for a specific group and directory in UNIX?
a) groupdu
b) gdu
c) du -g
d) du -group
Answer: c) du -g
Explanation: The du command with the -g option is used to display disk usage for a specific group and directory in UNIX.
20. What is the purpose of the -n option in the df command?
a) Display usage for remote file systems
b) Display usage for mounted file systems
c) Display file system type
d) Do not display header
Answer: d) Do not display header
Explanation: The -n option of the df command is used to not display the header in UNIX.
21. Which command is used to display disk usage for a specific user and file system in UNIX?
a) userdu
b) du -u
c) du -user
d) du -fs
Answer: b) du -u
Explanation: The du command with the -u option is used to display disk usage for a specific user and file system in UNIX.
22. What is the purpose of the -x option in the du command?
a) Exclude specific files
b) Display usage in human-readable format
c) Display usage for specific file systems only
d) Display usage in kilobytes
Answer: c) Display usage for specific file systems only
Explanation: The -x option of the du command is used to display disk usage for specific file systems only in UNIX.
23. Which command is used to display the disk usage statistics for the specified directory and its subdirectories in UNIX, with the sizes shown in human-readable format?
a) du -h
b) du -s
c) du -S
d) du -k
Answer: a) du -h
Explanation: The du command with the -h option displays the disk usage statistics for the specified directory and its subdirectories in UNIX, with the sizes shown in human-readable format.
24. What is the purpose of the -T option in the du command?
a) Exclude specific files
b) Include specific files
c) Display usage in human-readable format
d) Display usage in kilobytes
Answer: b) Include specific files
Explanation: The -T option of the du command is used to include specific files in disk usage calculations in UNIX.
25. Which command is used to display disk usage for a specific project and directory in UNIX?
a) projdu
b) projectdu
c) du -p
d) du -project
Answer: c) du -p
Explanation: The du command with the -p option is used to display disk usage for a specific project and directory in UNIX.
26. What is the purpose of the -o option in the df command?
a) Display quota information
b) Display usage for mounted file systems
c) Display file system type
d) Display usage in human-readable format
Answer: a) Display quota information
Explanation: The -o option of the df command is used to display quota information in UNIX.
27. Which command is used to display the disk usage statistics for the specified directory and its subdirectories in UNIX, while suppressing error messages for inaccessible files?
a) du -S
b) du -sh
c) du -k
d) du -S
Answer: d) du -S
Explanation: The du command with the -S option displays the disk usage statistics for the specified directory and its subdirectories in UNIX, suppressing error messages for inaccessible files.
28. What is the purpose of the -g option in the df command?
a) Display usage for specific users
b) Display usage for specific groups
c) Display usage in human-readable format
d) Display usage for remote file systems
Answer: b) Display usage for specific groups
Explanation: The -g option of the df command is used to display disk usage for specific groups in UNIX.
29. Which command is used to display the disk usage statistics for the specified directory and its subdirectories in UNIX, while displaying the sizes in kilobytes?
a) du -k
b) du -h
c) du -S
d) du -s
Answer: a) du -k
Explanation: The du command with the -k option displays the disk usage statistics for the specified directory and its subdirectories in UNIX, showing sizes in kilobytes.
30. What is the purpose of the -d option in the du command?
a) Display usage in human-readable format
b) Display usage in kilobytes
c) Display usage for specific groups
d) Set maximum depth of recursion
Answer: d) Set maximum depth of recursion
Explanation: The -d option of the du command is used to set the maximum depth of recursion for disk usage calculations in UNIX.
31. Which command is used to display disk usage for a specific project and directory in UNIX?
a) projdu
b) projectdu
c) du -p
d) du -project
Answer: c) du -p
Explanation: The du command with the -p option is used to display disk usage for a specific project and directory in UNIX.
32. What is the purpose of the -R option in the df command?
a) Display usage for remote file systems
b) Display usage for mounted file systems
c) Display file system type
d) Display usage in human-readable format
Answer: a) Display usage for remote file systems
Explanation: The -R option of the df command is used to display disk usage for remote file systems in UNIX.
33. Which command is used to display the disk usage statistics for the specified directory and its subdirectories in UNIX, while displaying the sizes in human-readable format?
a) du -k
b) du -h
c) du -S
d) du -s
Answer: b) du -h
Explanation: The du command with the -h option displays the disk usage statistics for the specified directory and its subdirectories in UNIX, showing sizes in human-readable format.
34. What is the purpose of the -m option in the df command?
a) Display usage in human-readable format
b) Display usage in megabytes
c) Display file system type
d) Display usage for remote file systems
Answer: b) Display usage in megabytes
Explanation: The -m option of the df command is used to display disk usage in megabytes in UNIX.
35. Which command is used to display disk usage for a specific file system type and directory in UNIX?
a) fsdu
b) fsusage
c) du -fs
d) du -file
Answer: c) du -fs
Explanation: The du command with the -fs option is used to display disk usage for a specific file system type and directory in UNIX.
36. Which command is used to display the disk usage of a specific directory and its subdirectories in UNIX, sorted by modification time?
a) du -t
b) du -m
c) du -c
d) du -u
Answer: a) du -t
Explanation: The du command with the -t option displays the disk usage of a specific directory and its subdirectories in UNIX, sorted by modification time.
37. What is the purpose of the -j option in the df command?
a) Display quota information
b) Display usage in human-readable format
c) Generate a JSON report
d) Display usage for remote file systems
Answer: c) Generate a JSON report
Explanation: The -j option of the df command is used to generate a JSON report in UNIX.
38. Which command is used to set disk quotas for a specific user and file system in UNIX?
a) setquota
b) edquota
c) userquota
d) quotaon
Answer: b) edquota
Explanation: The edquota command is used to set disk quotas for a specific user and file system in UNIX.
39. What is the purpose of the -I option in the du command?
a) Include specific files
b) Display usage in human-readable format
c) Exclude specific files
d) Display usage in kilobytes
Answer: c) Exclude specific files
Explanation: The -I option of the du command is used to exclude specific files from disk usage calculations in UNIX.
40. Which command is used to set soft limits for disk quotas in UNIX?
a) setsoftquota
b) edquota
c) setquota
d) setlimquota
Answer: b) edquota
Explanation: The edquota command is used to set soft limits for disk quotas in UNIX.
41. What is the purpose of the -H option in the du command?
a) Display usage in human-readable format
b) Display usage for mounted file systems
c) Follow symbolic links
d) Display usage in kilobytes
Answer: c) Follow symbolic links
Explanation: The -H option of the du command is used to follow symbolic links and calculate disk space usage accordingly in UNIX.
42. Which command is used to display disk usage for a specific user and file system type in UNIX?
a) userdu
b) du -u
c) du -user
d) du -fs
Answer: b) du -u
Explanation: The du command with the -u option is used to display disk usage for a specific user and file system type in UNIX.
43. What is the purpose of the -q option in the df command?
a) Do not display header
b) Display quota information
c) Display usage in human-readable format
d) Query quota status
Answer: d) Query quota status
Explanation: The -q option of the df command is used to query quota status in UNIX.
44. Which command is used to display disk usage for a specific project and directory in UNIX?
a) projdu
b) projectdu
c) du -p
d) du -project
Answer: c) du -p
Explanation: The du command with the -p option is used to display disk usage for a specific project and directory in UNIX.
45. What is the purpose of the -v option in the quotaon command?
a) Perform a verbose operation
b) Display version information
c) Enable quotas for all users
d) View quota usage
Answer: a) Perform a verbose operation
Explanation: The -v option of the quotaon command is used to perform a verbose operation in UNIX.
46. Which command is used to display disk usage for a specific group and file system type in UNIX?
a) groupdu
b) gdu
c) du -g
d) du -group
Answer: c) du -g
Explanation: The du command with the -g option is used to display disk usage for a specific group and file system type in UNIX.
47. What is the purpose of the -N option in the df command?
a) Do not display header
b) Display usage for remote file systems
c) Display usage for mounted file systems
d) Display file system type
Answer: a) Do not display header
Explanation: The -N option of the df command is used to not display the header in UNIX.
48. Which command is used to display disk usage for a specific file system type and file in UNIX?
a) fsdu
b) fsusage
c) du -fs
d) du -file
Answer: c) du -fs
Explanation: The du command with the -fs option is used to display disk usage for a specific file system type and file in UNIX.
49. What is the purpose of the -o option in the quotaon command?
a) Display quota information
b) Perform a quick operation
c) Enable quotas for all users
d) Specify quota file location
Answer: d) Specify quota file location
Explanation: The -o option of the quotaon command is used to specify the quota file location in UNIX.
50. Which command is used to display the disk usage of a specific directory and its subdirectories in UNIX, while displaying the sizes in megabytes?
a) du -m
b) du -h
c) du -S
d) du -s
Answer: a) du -m
Explanation: The du command with the -m option displays the disk usage of a specific directory and its subdirectories in UNIX, showing sizes in megabytes.