Unix Questions and Answers – Administrator Specific Commands and Privileges – 3

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?
a) du
b) df
c) mem
d) dv
View Answer

Answer: a
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?
a) -e
b) -f
c) -e
d) -s
View Answer

Answer: d
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

advertisement
advertisement

3. du command can also be used for reporting the disk space consumed by each user.
a) True
b) False
View Answer

Answer: a
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.

Sanfoundry Certification Contest of the Month is Live. 100+ Subjects. Participate Now!
# du  -s  /home/*

4. A device file contains no data.
a) True
b) False
View Answer

Answer: a
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.
advertisement

5. All the device files are stored in _____
a) kernel
b) /home/usr
c) /dev
d) /home
View Answer

Answer: c
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
View Answer

Answer: c
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.
advertisement

7. For formatting diskettes, we can use the _______ command.
a) format
b) fdformat
c) frmt
d) format and fdformat
View Answer

Answer: d
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.
a) pp
b) df
c) du
d) dd
View Answer

Answer: d
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?
a) bckup
b) trap
c) ciop
d) cpio
View Answer

Answer: d
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.
a) True
b) False
View Answer

Answer: a
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?
a) -a
b) -i
c) -o
d) -i and -o
View Answer

Answer: d
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.
a) -a
b) -c
c) -d
d) -f
View Answer

Answer: b
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.
a) -a
b) -c
c) -v
d) -x
View Answer

Answer: d
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.
a) True
b) False
View Answer

Answer: a
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.
a) True
b) False
View Answer

Answer: b
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.

If you find a mistake in question / option / answer, kindly take a screenshot and email to [email protected]

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.