UNIX Question and Answer – File System Administration
UNIX MCQ – Multiple Choice Questions for exam, interview, and Entrance Test
1. What command is used to display the disk space usage of a specific file or directory in UNIX, while suppressing error messages for inaccessible files?
a) du -s
b) du -h
c) du -S
d) du -q
Answer: c) du -S
Explanation: The du command with the -S option suppresses error messages for inaccessible files in UNIX.
2. Which command is used to display disk space usage statistics for each subdirectory in UNIX, sorted by size?
a) du -h
b) du -s
c) du -S
d) du -k
Answer: d) du -k
Explanation: The du command with the -k option displays disk space usage statistics for each subdirectory in UNIX, sorted by size.
3. What is the purpose of the -x option in the du command?
a) Display usage in kilobytes
b) Exclude file system mount points
c) Display usage for specific file systems only
d) Display usage in human-readable format
Answer: b) Exclude file system mount points
Explanation: The -x option of the du command excludes file system mount points from disk usage calculations in UNIX.
4. Which command is used to display the inode usage of a file system in UNIX?
a) inode
b) ls -i
c) df -i
d) du -i
Answer: c) df -i
Explanation: The df command with the -i option is used to display the inode usage of a file system in UNIX.
5. What is the purpose of the quotasync() system call in UNIX?
a) Synchronize quota updates
b) Calculate disk quotas
c) Display quota usage
d) Update quota files
Answer: a) Synchronize quota updates
Explanation: The quotasync() system call is used to synchronize quota updates in UNIX.
6. Which command is used to display the disk space usage statistics for each file and directory in UNIX, including hidden files?
a) du -h
b) du -a
c) du -s
d) du -S
Answer: b) du -a
Explanation: The du command with the -a option displays disk space usage statistics for each file and directory in UNIX, including hidden files.
7. What is the purpose of the -k option in the df command?
a) Display usage in kilobytes
b) Display usage in human-readable format
c) Display kernel information
d) Display hidden files
Answer: a) Display usage in kilobytes
Explanation: The -k option of the df command is used to display disk usage in kilobytes in UNIX.
8. Which command is used to display the disk space usage of files and directories 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 space usage of files and directories in UNIX, sorted by size.
9. What is the purpose of the -t option in the df command?
a) Display total disk space
b) Display total disk usage
c) Display total inodes
d) Display total file systems
Answer: b) Display total disk usage
Explanation: The -t option of the df command is used to display the total disk usage in UNIX.
10. Which command is used to display the disk space usage statistics for each file and directory in UNIX, with summary information?
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 disk space usage statistics for each file and directory in UNIX, along with summary information.
11. What is the purpose of the -h option in the df command?
a) Display usage in human-readable format
b) Display hidden files
c) Display usage for mounted file systems
d) Display usage in hierarchical format
Answer: a) Display usage in human-readable format
Explanation: The -h option of the df command is used to display disk usage in human-readable format in UNIX.
12. Which command is used to display the disk space usage statistics for each file and directory in UNIX, with grand total?
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 disk space usage statistics for each file and directory in UNIX, along with the grand total.
13. What is the purpose of the -P option in the du command?
a) Display usage in human-readable format
b) Include hidden files
c) Follow symbolic links
d) Display usage in kilobytes
Answer: c) Follow symbolic links
Explanation: The -P option of the du command is used to follow symbolic links and calculate disk space usage accordingly in UNIX.
14. Which command is used to display the disk space usage statistics for each file and directory in UNIX, sorted by modification time?
a) du -m
b) du -t
c) du -a
d) du -c
Answer: b) du -t
Explanation: The du command with the -t option displays disk space usage statistics for each file and directory in UNIX, sorted by modification time.
15. What is the purpose of the -v option in the du command?
a) Perform a verbose check
b) Perform a quick check
c) Verify quota file integrity
d) Display version information
Answer: a) Perform a verbose check
Explanation: The -v option of the du command is used to perform a verbose check, displaying detailed information during the process in UNIX.
16. Which command is used to display the disk space usage statistics for each file and directory in UNIX, in a specific format suitable for parsing?
a) du -f
b) du -a
c) du -o
d) du -0
Answer: d) du -0
Explanation: The du command with the -0 option displays disk space usage statistics for each file and directory in UNIX, in a null-delimited format suitable for parsing.
17. What is the purpose of the -x option in the du command?
a) Display usage in kilobytes
b) Exclude file system mount points
c) Display usage for specific file systems only
d) Display usage in human-readable format
Answer: b) Exclude file system mount points
Explanation: The -x option of the du command excludes file system mount points from disk usage calculations in UNIX.
18. Which command is used to display the disk space usage statistics for each file and directory in UNIX, with the specified maximum depth of recursion?
a) du -d
b) du -r
c) du -m
d) du -l
Answer: a) du -d
Explanation: The du command with the -d option displays disk space usage statistics for each file and directory in UNIX, with the specified maximum depth of recursion.
19. What is the purpose of the -m option in the df command?
a) Display usage in megabytes
b) Display usage in megabits
c) Display usage in human-readable format
d) Display usage for mounted file systems
Answer: c) Display usage in human-readable format
Explanation: The -m option of the df command is used to display disk usage in megabytes in UNIX.
20. Which command is used to display the disk space usage statistics for each file and directory in UNIX, sorted by name?
a) du -n
b) du -s
c) du -S
d) du -c
Answer: a) du -n
Explanation: The du command with the -n option displays disk space usage statistics for each file and directory in UNIX, sorted by name.
21. Which command is used to set disk quotas for a specific user and file system in UNIX?
a) userquota
b) edquota
c) setquota
d) quotaon
Answer: b) edquota
Explanation: The edquota command is used to set disk quotas for a specific user and file system in UNIX.
22. What is the purpose of the -T option in the df command?
a) Display usage in human-readable format
b) Display file system type
c) Display usage for mounted file systems
d) Display usage in megabytes
Answer: b) Display file system type
Explanation: The -T option of the df command is used to display the file system type in UNIX.
23. Which command is used to set disk quotas for a specific group 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 in UNIX.
24. What is the purpose of the -F option in the df command?
a) Display usage in human-readable format
b) Display file system type
c) Display usage for mounted file systems
d) Display usage in megabytes
Answer: c) Display usage for mounted file systems
Explanation: The -F option of the df command is used to display usage for mounted file systems in UNIX.
25. Which command is used to enable disk quotas on a file system in UNIX?
a) quotaon
b) setquota
c) edquota
d) quotacheck
Answer: a) quotaon
Explanation: The quotaon command is used to enable disk quotas on a file system in UNIX.
26. What is the purpose of the -D option in the df command?
a) Display usage in human-readable format
b) Display usage for mounted file systems
c) Display usage in megabytes
d) Display usage for remote file systems
Answer: d) Display usage for remote file systems
Explanation: The -D option of the df command is used to display usage for remote file systems in UNIX.
27. Which command is used to disable disk quotas on a file system in UNIX?
a) quotacheck
b) quotaoff
c) setquota
d) edquota
Answer: b) quotaoff
Explanation: The quotaoff command is used to disable disk quotas on a file system in UNIX.
28. What is the purpose of the -v option in the quotaon command?
a) Perform a verbose operation
b) Verify quota file integrity
c) Display version information
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.
29. Which command is used to display disk usage for a specific project in UNIX?
a) projquota
b) setprojquota
c) edprojquota
d) projectquota
Answer: b) setprojquota
Explanation: The setprojquota command is used to display disk usage for a specific project in UNIX.
30. What is the purpose of the -n option in the quotaoff command?
a) Do not update quota file
b) Perform a quick operation
c) Display quota usage
d) Disable quotas for a specific user
Answer: a) Do not update quota file
Explanation: The -n option of the quotaoff command is used to not update the quota file in UNIX.
31. Which command is used to display disk usage for a specific user 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 in UNIX.
32. What is the purpose of the -g option in the quotaon command?
a) Enable quotas for a specific group
b) Display group quotas
c) Verify quota file integrity
d) Perform a quick operation
Answer: a) Enable quotas for a specific group
Explanation: The -g option of the quotaon command is used to enable quotas for a specific group in UNIX.
33. Which command is used to display the number of inodes used and available on a file system in UNIX, while suppressing any error messages?
a) df -i
b) df -n
c) df -I
d) df -e
Answer: a) df -i
Explanation: The df command with the -i option is used to display the number of inodes used and available on a file system in UNIX, suppressing any error messages.
34. What is the purpose of the -p option in the quotaon command?
a) Perform a verbose operation
b) Display usage in human-readable format
c) Enable quotas for all users
d) Display project quotas
Answer: c) Enable quotas for all users
Explanation: The -p option of the quotaon command is used to enable quotas for all users in UNIX.
35. Which command is used to display disk usage for a specific file system in UNIX?
a) fsdu
b) fsusage
c) du -f
d) du -fs
Answer: c) du -f
Explanation: The du command with the -f option is used to display disk usage for a specific file system in UNIX.
36. What is the purpose of the -l option in the quotaon command?
a) Display usage in human-readable format
b) List all quotas
c) Enable quotas for a specific project
d) Perform a quick operation
Answer: b) List all quotas
Explanation: The -l option of the quotaon command is used to list all quotas in UNIX.
37. Which command is used to display disk usage for a specific group 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 in UNIX.
38. What is the purpose of the -r option in the quotaon command?
a) Perform a verbose operation
b) Read quota file
c) Enable quotas for a specific user
d) Display usage in human-readable format
Answer: b) Read quota file
Explanation: The -r option of the quotaon command is used to read the quota file in UNIX.
39. Which command is used to display disk usage for a specific file system type in UNIX?
a) fdu
b) du -t
c) du -fstype
d) du -filetype
Answer: b) du -t
Explanation: The du command with the -t option is used to display disk usage for a specific file system type in UNIX.
40. What is the purpose of the -q option in the quotaon command?
a) Query quota status
b) Perform a quick operation
c) Display usage in kilobytes
d) Enable quotas for a specific user
Answer: a) Query quota status
Explanation: The -q option of the quotaon command is used to query quota status in UNIX.
41. Which command is used to display the disk usage of a specific directory and its subdirectories in UNIX, sorted by size?
a) du -S
b) du -sh
c) du -k
d) du -h
Answer: c) du -k
Explanation: The du command with the -k option displays the disk usage of a specific directory and its subdirectories in UNIX, sorted by size.
42. What is the purpose of the -I 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: a) Exclude specific files
Explanation: The -I option of the du command is used to exclude specific files from disk usage calculations in UNIX.
43. Which command is used to display the disk usage of each file and directory 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 each file and directory in UNIX, sorted by modification time.
44. What is the purpose of the -Q option in the df command?
a) Display quota information
b) Display file system type
c) Display usage in human-readable format
d) Display usage for remote file systems
Answer: a) Display quota information
Explanation: The -Q option of the df command is used to display quota information in UNIX.
45. 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.
46. What is the purpose of the -C option in the du command?
a) Exclude specific files
b) Display usage in human-readable format
c) Display total usage
d) Display usage for remote file systems
Answer: c) Display total usage
Explanation: The -C option of the du command is used to display the total disk usage in UNIX.
47. Which command is used to display the disk usage of each file and directory in UNIX, in a specific format suitable for parsing?
a) du -0
b) du -f
c) du -p
d) du -P
Answer: a) du -0
Explanation: The du command with the -0 option displays the disk usage of each file and directory in UNIX in a null-delimited format suitable for parsing.
48. 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.
49. Which command is used to set disk quotas for a specific user and file system type in UNIX?
a) userquota
b) setquota
c) edquota
d) quotaon
Answer: b) setquota
Explanation: The setquota command is used to set disk quotas for a specific user and file system type in UNIX.
50. 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.