UNIX MCQs – File System Structure (Part – 4)

UNIX Question and Answer – File System Structure

UNIX MCQ – Multiple Choice Questions for exam, interview, and Entrance Test

1. What is the purpose of the ln command with the -i option in UNIX?

a) Create hard links interactively

b) Create symbolic links interactively

c) Move files interactively

d) Remove files interactively

Answer: a) Create hard links interactively

Explanation: The ln command in UNIX with the -i option prompts the user before creating hard links.


2. Which command is used to create a new empty file in UNIX?

a) create

b) touch

c) newfile

d) mkfile

Answer: b) touch

Explanation: The touch command in UNIX is used to create a new empty file.


3. What is the purpose of the find command with the -exec option in UNIX?

a) Execute a command on files found by find

b) Display detailed information about files found by find

c) Print file names found by find

d) Change permissions of files found by find

Answer: a) Execute a command on files found by find

Explanation: The find command in UNIX with the -exec option is used to execute a command on files found by find.


4. Which command is used to change the size of a file in UNIX?

a) modify

b) resize

c) truncate

d) extend

Answer: c) truncate

Explanation: The truncate command in UNIX is used to change the size of a file.


5. What is the purpose of the ls command with the -F option in UNIX?

a) List files in long format

b) List files with sizes

c) Append file type indicators

d) Display hidden files

Answer: c) Append file type indicators

Explanation: The ls command in UNIX with the -F option is used to append file type indicators to file names.


6. Which command is used to display the permissions of a file in UNIX?

a) permissions

b) ls -p

c) ls -l

d) perms

Answer: c) ls -l

Explanation: The ls -l command in UNIX is used to display detailed information about files, including their permissions.


7. What is the purpose of the find command with the -empty option in UNIX?

a) Search for empty directories

b) Search for empty files

c) Search for empty symbolic links

d) Search for empty files and directories

Answer: d) Search for empty files and directories

Explanation: The find command in UNIX with the -empty option is used to search for empty files and directories.


8. Which command is used to change the permissions of a file or directory in UNIX?

a) chperm

b) chown

c) chmod

d) chgrp

Answer: c) chmod

Explanation: The chmod command in UNIX is used to change the permissions of a file or directory.


9. What is the purpose of the cp command with the -v option in UNIX?

a) Copy files recursively

b) Copy files with progress

c) Copy files preserving file attributes

d) Copy files interactively

Answer: b) Copy files with progress

Explanation: The cp command in UNIX with the -v option is used to copy files with progress, displaying information about the files being copied.


10. Which command is used to display the inode number of a file in UNIX?

a) stat

b) inode

c) ls -i

d) fileinfo

Answer: c) ls -i

Explanation: The ls -i command in UNIX is used to display the inode number of a file.


11. What is the purpose of the ln command with the -r option in UNIX?

a) Create symbolic links

b) Create hard links

c) Remove links

d) Rename links

Answer: b) Create hard links

Explanation: The ln command in UNIX with the -r option is used to create hard links.


12. Which command is used to display the disk space usage of file systems in UNIX?

a) fsusage

b) dfs

c) df

d) diskusage

Answer: c) df

Explanation: The df command in UNIX is used to display information about file systems, including their disk space usage.


13. What is the purpose of the mv command with the -b option in UNIX?

a) Move files backup

b) Move files interactively

c) Move files silently

d) Move files forcibly

Answer: a) Move files backup

Explanation: The mv command in UNIX with the -b option is used to move files and create a backup of existing files if they are overwritten.


14. Which command is used to display the disk space usage of a file or directory in UNIX?

a) diskspace

b) du

c) df

d) spaceutil

Answer: b) du

Explanation: The du command in UNIX is used to display the disk space usage of a file or directory.


15. What is the purpose of the ln command with the -d option in UNIX?

a) Create hard links

b) Create symbolic links

c) Delete links

d) Display file details

Answer: b) Create symbolic links

Explanation: The ln command in UNIX with the -d option is used to create symbolic links.


16. Which command is used to display the block size of a file system in UNIX?

a) fsblksize

b) blocksize

c) blksize

d) stat

Answer: d) stat

Explanation: The stat command is used to display detailed information about files and file systems in UNIX, including the block size.


17. What is the purpose of the find command with the -name option in UNIX?

a) Search for files by name

b) Search for files by type

c) Search for files by size

d) Search for files by content

Answer: a) Search for files by name

Explanation: The find command with the -name option is used to search for files in UNIX based on their names.


18. Which command is used to change the permissions of a file or directory in UNIX?

a) chmod

b) chown

c) chgrp

d) perm

Answer: a) chmod

Explanation: The chmod command is used to change the permissions of a file or directory in UNIX.


19. What is the purpose of the ln command with the -s option in UNIX?

a) Create symbolic links

b) Create hard links

c) Remove links

d) Rename links

Answer: a) Create symbolic links

Explanation: The ln command with the -s option is used to create symbolic links in UNIX.


20. Which command is used to display the disk space usage of file systems in UNIX?

a) fsusage

b) dfs

c) df

d) diskusage

Answer: c) df

Explanation: The df command is used to display information about file systems in UNIX, including their disk space usage.


21. What is the purpose of the touch command with the -r option in UNIX?

a) Change file permissions

b) Change file timestamps to match another file

c) Change file ownership

d) Change file type

Answer: b) Change file timestamps to match another file

Explanation: The touch command with the -r option is used to change the timestamps of a file to match another file in UNIX.


22. Which command is used to display the block size of a file system in UNIX?

a) fsblksize

b) blocksize

c) blksize

d) stat

Answer: d) stat

Explanation: The stat command is used to display detailed information about files and file systems in UNIX, including the block size.


23. What is the purpose of the find command with the -name option in UNIX?

a) Search for files by name

b) Search for files by type

c) Search for files by size

d) Search for files by content

Answer: a) Search for files by name

Explanation: The find command with the -name option is used to search for files in UNIX based on their names.


24. Which command is used to change the permissions of a file or directory in UNIX?

a) chmod

b) chown

c) chgrp

d) perm

Answer: a) chmod

Explanation: The chmod command is used to change the permissions of a file or directory in UNIX.


25. What is the purpose of the ln command with the -s option in UNIX?

a) Create symbolic links

b) Create hard links

c) Remove links

d) Rename links

Answer: a) Create symbolic links

Explanation: The ln command with the -s option is used to create symbolic links in UNIX.


26. What is the purpose of the touch command with the -m option in UNIX?

a) Modify file permissions

b) Modify file timestamps

c) Modify file ownership

d) Modify file size

Answer: b) Modify file timestamps

Explanation: The touch command with the -m option is used to modify the modification timestamp of a file in UNIX.


27. Which command is used to display the block size of a file system in UNIX?

a) fsblksize

b) blocksize

c) blksize

d) stat

Answer: d) stat

Explanation: The stat command in UNIX is used to display detailed information about files and file systems, including the block size.


28. What is the purpose of the find command with the -name option in UNIX?

a) Search for files by name

b) Search for files by type

c) Search for files by size

d) Search for files by content

Answer: a) Search for files by name

Explanation: The find command with the -name option is used to search for files in UNIX based on their names.


29. Which command is used to change the permissions of a file or directory in UNIX?

a) chmod

b) chown

c) chgrp

d) perm

Answer: a) chmod

Explanation: The chmod command in UNIX is used to change the permissions of a file or directory.


30. What is the purpose of the ln command with the -s option in UNIX?

a) Create symbolic links

b) Create hard links

c) Remove links

d) Rename links

Answer: a) Create symbolic links

Explanation: The ln command with the -s option is used to create symbolic links in UNIX.


31. Which command is used to display the disk space usage of file systems in UNIX?

a) fsusage

b) dfs

c) df

d) diskusage

Answer: c) df

Explanation: The df command in UNIX is used to display information about file systems, including their disk space usage.


32. What is the purpose of the find command with the -exec option in UNIX?

a) Execute a command on files found by find

b) Display detailed information about files found by find

c) Print file names found by find

d) Change permissions of files found by find

Answer: a) Execute a command on files found by find

Explanation: The find command with the -exec option is used to execute a command on files found by find.


33. Which command is used to display the inode number of a file in UNIX?

a) stat

b) inode

c) ls -i

d) fileinfo

Answer: c) ls -i

Explanation: The ls -i command in UNIX is used to display the inode number of a file.


34. What is the purpose of the ln command with the -d option in UNIX?

a) Create hard links

b) Create symbolic links

c) Delete links

d) Display file details

Answer: b) Create symbolic links

Explanation: The ln command with the -d option is used to create symbolic links in UNIX.


35. Which command is used to display the disk space usage of a file or directory in UNIX?

a) diskspace

b) du

c) df

d) spaceutil

Answer: b) du

Explanation: The du command in UNIX is used to display the disk space usage of a file or directory.


36. What is the purpose of the umask command in UNIX?

a) Display current user

b) Set default permissions for newly created files

c) Mount a file system

d) Unmount a file system

Answer: b) Set default permissions for newly created files

Explanation: The umask command in UNIX is used to set the default permissions for newly created files and directories.


37. Which command is used to display the file type and permissions in symbolic format in UNIX?

a) filetype

b) ls -l

c) ls -F

d) ls -s

Answer: b) ls -l

Explanation: The ls -l command in UNIX is used to display detailed information about files, including their type and permissions in symbolic format.


38. What is the purpose of the mkfifo command in UNIX?

a) Make a regular file

b) Make a named pipe

c) Make a symbolic link

d) Make a hard link

Answer: b) Make a named pipe

Explanation: The mkfifo command in UNIX is used to create a named pipe, also known as a FIFO (First-In-First-Out).


39. Which command is used to change the owner and group of a file or directory in UNIX?

a) chown

b) chgrp

c) chmod

d) owngrp

Answer: a) chown

Explanation: The chown command in UNIX is used to change the owner and group of a file or directory.


40. What is the purpose of the ln command with the -t option in UNIX?

a) Create symbolic links

b) Create hard links

c) Remove links

d) Display file details

Answer: a) Create symbolic links

Explanation: The ln command with the -t option specifies a target directory where symbolic links should be created in UNIX.


41. Which command is used to display the file system type of a mounted file system in UNIX?

a) fstype

b) fsinfo

c) df

d) mount

Answer: c) df

Explanation: The df command in UNIX is used to display information about mounted file systems, including their type.


42. What is the purpose of the cp command with the -r option in UNIX?

a) Copy files recursively

b) Copy files with progress

c) Copy files preserving file attributes

d) Copy files interactively

Answer: a) Copy files recursively

Explanation: The cp command with the -r option is used to copy files and directories recursively in UNIX.


43. Which command is used to create a hard link to a file in UNIX?

a) link

b) ln -s

c) hlink

d) ln

Answer: d) ln

Explanation: The ln command in UNIX is used to create hard links to files.


44. What is the purpose of the rm command with the -f option in UNIX?

a) Remove files forcibly

b) Remove files interactively

c) Remove files silently

d) Remove files recursively

Answer: a) Remove files forcibly

Explanation: The rm command with the -f option is used to remove files forcibly in UNIX, without prompting for confirmation.


45. Which command is used to display the file type of a file in UNIX?

a) type

b) file

c) filetype

d) format

Answer: b) file

Explanation: The file command in UNIX is used to display the file type of a file.


46. What is the purpose of the cp command with the -i option in UNIX?

a) Copy files interactively

b) Copy files forcefully

c) Copy files silently

d) Copy files recursively

Answer: a) Copy files interactively

Explanation: The cp command with the -i option is used to copy files interactively in UNIX, prompting the user before overwriting existing files.


47. Which command is used to display the file system type of a mounted file system in UNIX?

a) fstype

b) fsinfo

c) df

d) mount

Answer: c) df

Explanation: The df command in UNIX is used to display information about mounted file systems, including their type.


48. What is the purpose of the umask command in UNIX?

a) Display current user

b) Set default permissions for newly created files

c) Mount a file system

d) Unmount a file system

Answer: b) Set default permissions for newly created files

Explanation: The umask command in UNIX is used to set the default permissions for newly created files and directories.


49. Which command is used to display the detailed information about a file, including its inode number, permissions, and ownership in UNIX?

a) file

b) ls -l

c) stat

d) info

Answer: c) stat

Explanation: The stat command in UNIX is used to display detailed information about files, including their inode number, permissions, and ownership.


50. What is the purpose of the cp command with the -v option in UNIX?

a) Copy files recursively

b) Copy files with progress

c) Copy files preserving file attributes

d) Copy files interactively

Answer: b) Copy files with progress

Explanation: The cp command with the -v option is used to copy files with progress in UNIX, displaying information about the files being copied.

Related Articles

Linux MCQ

Welcome to Linux Multiple Choice Questions (MCQ) Section Embark on a journey through the world of...