This set of Unix Multiple Choice Questions & Answers (MCQs) focuses on “Administrator Specific Commands and Privileges – 3”.
1. Which command is used to find out the consumption of a specific directory?
Explanation: Sometimes, we may need to find out the consumption of a specific directory rather than an entire file system. For this purpose, du command is used. This command reports usage by recursive examination of the directory structure.
2. Which option is used with du command for finding only the summary of disk usage by a specific directory?
Explanation: If we use the du command, then by default it displays the usage of each subdirectory of its argument along with a summary at the end. If we want to display the only summary then we can use -s option with du command. For example,
# du -s /home/user10/doc 78954 /home/user10/doc
3. du command can also be used for reporting the disk space consumed by each user.
Explanation: Most of the dynamic space in the system is consumed by users, their directories and files. We can use the following command if we want to know the disk space consumed by each user.
# du -s /home/*
4. A device file contains no data.
Explanation: A device file is a file which is built into the kernel for each and every device of the system. Whenever we open a device, read or write to it, all these functions are performed using device files.
5. All the device files are stored in _____
Explanation: A device file is a file which is built into the kernel for each and every device of the system. All the device files are stored in /dev or in its subdirectories. To view the list of device files on your system, use the following command:
# ls -l /dev
6. The set of routines needed to operate a specific device is known as ________
a) device file
b) device program
c) device driver
d) device software
Explanation: The set of routines needed to operate a specific device is known as a device driver. Whenever a particular device is accessed, the kernel calls the correct device driver and passes some parameters to it.
7. For formatting diskettes, we can use the _______ command.
d) format and fdformat
Explanation: Before backing up data to a floppy, we may need to format it. For this purpose, either format or fdformat command is used (whichever is supported by your system).
8. ___ command performs copying of diskettes.
Explanation: dd (disk jump) command can be used in copying files systems, but is majorly used for copying media (floppies and tapes).
9. Which of the following is a backup program?
Explanation: As a system administrator, you are responsible for creating a backup of the data which resides on your system. For this purpose, there are mainly two backup programs which are extensively used i.e. cpio and tar. The cpio command copies files to and from a backup device.
10. cpio program can be used with redirection and piping.
Explanation: The cpio command copies files to and from a backup device. It uses the standard input for taking the list of filenames and then copies them with their content and header to standard output which can also be redirected to a file or a device. Hence, cpio can be used with redirection and piping.
11. Which of the following options are used with the cpio program?
d) -i and -o
Explanation: cpio command uses two key options, -o (output) and -i (input). The -o option is used for backing up files while the -i option is used for restoring files.
12. tar command uses ___ option for backing up files.
Explanation: The tar (tape archive) command is more powerful than cpio command. For creating a backup using tar, we have to use the -c option. For example,
# tar -cvf /dev/rdsk/f0987yu /home/user/doc/SQL
13. For restoring files using tar, ____ option is used.
Explanation: Files can be restored using -x option with the tar command. When no file or directory is specified it restores all the files from the backup device.
# tar -xvf /dev/rdsk/f0987yu
14. For displaying the archive, -t option is used with the tar command.
Explanation: -t option alike cpio is also used with tar command for displaying the archive. For example,
# tar -tvf /dev/rdsk/f0987yu
15. tar command can use the standard input to obtain its file list.
Explanation: tar command cannot use the standard input to obtain its file list. It accepts only file and directory name as arguments.
Sanfoundry Global Education & Learning Series – Unix.
To practice all areas of Unix, here is complete set of 1000+ Multiple Choice Questions and Answers.