/var/spool contains data which is awaiting some kind of later processing. Data in /var/spool represents work to be done in the future (by a program, user, or administrator); often data is deleted after it has been processed. The following directories, or symbolic links to directories, must be in /var/spool, if the corresponding subsystem is installed: 5.14.3. /var/spool/lpd : Line-printer daemon print queues (optional)The lock file for lpd, lpd.lock, must be placed in /var/spool/lpd. It is suggested that the lock file for each printer be placed in the spool directory for that specific printer and named lock. 5.14.3.2. Specific Options5.14.4. /var/spool/rwho : Rwhod files (optional)This directory holds the rwhod information for other systems on the local net. Some BSD releases use /var/rwho for this data; given its historical location in /var/spool on other systems and its approximate fit to the definition of `spooled' data, this location was deemed more appropriate. Skip to content
This set of Unix Multiple Choice Questions & Answers (MCQs) focuses on “Locating Files: find Command”. 1. Which command is used for locating files? a) search b) find c) loc d) type View Answer Answer: b 2. The syntax of the find command is ____________ a) find path_list selection_criteria action b) find action path_list selection_criteria c) find selection_criteria action path d) find path action View Answer Answer: a $ find path_list selection_criteria action
Note: Join free Sanfoundry classes at Telegram or Youtube 3. Which symbol is used with find command for specifying arguments? a) + b) – c) + and – d) | View Answer Answer: c $ find . -name “*.c” -print 4. What will be the output of the following command? $ find / -name a.out -print a) all files having filename as a.out b) all files in the root directory c) undefined output d) erroneous View Answer Answer: a 5. We can use relative pathname in the path list while using find command. a) True b) False View Answer Answer: a $ find . -name “*.txt” -print // single quotes can also work 6. Which one of the following option is used for locating the files by inode number? a) -name b) -inum c) -inode d) -ind View Answer Answer: b $ find / -inum 13857 -print // display all the files linked (having same inode number) 7. Which option is used with find command for specifying the file type? a) -perm b) -inum c) -name d) -type View Answer Answer: d $ find . -type d -print // display all the directory files in the current directory 8. To specify permissions while using find command we have to use _____ option. a) -perm b) -inum c) -name d) -type View Answer Answer: a $ find $HOME -perm 666 -type d -print // select directories in the home directory having 666 (in octal) permissions. 9. Which option is used to find command to search for files based on access time? a) -atime b) -mtime c) -time d) -type View Answer Answer: a $ find . -atime -2 -print //display those files which have been last accessed in less than 2 days 10. Which of the following command will be used to locate those files that have not been modified for more than a year? a) find . -mtime 1 b) find . -mtime 1 year -print c) find . -mtime +365 -print d) find . -mtime -365 -print View Answer Answer: c 11. Which of the following operator is used with find command for performing the negate function? a) -a b) -o c) && d) ! View Answer Answer: d $ find . ! -name “*.c” -print // select all files but not the C program files. 12. Which operator is used to specify the AND condition in find command? a) ! b) && c) -A d) -a View Answer Answer: d $ find . \(-type f -a -mtime +2)\ -print // -a can also be omitted ( it is automatically implied by // default) 13. -o operator represents the OR condition. a) True b) False View Answer Answer: a 14. Which of the following option is used with find command for taking action on selected files? a) -exec b) -atime c) -mtime d) -a View Answer Answer: a $ find $HOME -type f -atime +365 -exec rm {} \; Above command will remove all ordinary files not accessed for more than a year. 15. -ok option is used with find command for seeking information before taking the action specified. a) True b) False View Answer Answer: a $ find $HOME -type f -atime +365 -ok rm {} \; Above command will ask for the user confirmation before removing each selected file. Sanfoundry Global Education & Learning Series – Unix. To practice all areas of Unix, here is complete set of 1000+ Multiple Choice Questions and Answers. Next Steps:
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 & technical discussions at Telegram SanfoundryClasses. Scroll back to top |