CS 497C - Quiz 2 - Name: ________________ Date: Monday, October 8 (in class) Part 1: (20 points - 4 points for each problem) (3) 1. How do you yank 5 lines in vi? (1) 5xx (2) 5yw (3) 5yy (4) 5xx (1) 2. Which command will tell you what directory you are currently in? (1) pwd (2) cd (3) mkdir (4) whatdir (4) 3. What character cannot be used when making a file name? (1) = (2) | (3) \_ (4) / (2) 4. What is equivalent to chmod u=rw,go=r file? (1) chmod 600 file (2) chmod 644 file (3) chmod 755 file (4) chmod 640 file (2) 5. How would you display all files including hidden ones in columns and identify directories and executables? (1) ls -u (2) ls -Fax (3) ls -r (4) ls -R Part 2: (30 points - 6 points for each problem) 1. How do you search forward for the string UNIX in vi? How do you repeat this search in the same direction? How do you repeat this search in the opposite direction? Ans: /UNIX searches forward for the string UNIX. n repeats the search in the same direction. N repeats the search in the opposite direction. 2. How does UNIX divide files into three categories? Ans: Ordinary file - Also known as regular file. It contains only data as a stream of characters. Directory file - A folder containing the names of other files and directories. Device file - It represents all hardware devices. 3. Discuss three ways of knowing your home directory. Ans: (1) Use cd; pwd (2) Use echo $HOME (3) Locate it in the line pertaining to your username in /etc/passwd. (4) Use finger username. 4. A file with -rwxr-xr-x has what permissions are assigned to it? Ans: Owner: read, write, execute; Group: read, execute; Others: read, execute. 5. What is the typical structure of a find command? Give an example? Ans: (1) find path_list selection_criteria action (2) find . -name "*.c" -print