590 likes | 711 Views
CSI 135. Quiz 6. Quiz 6. Choose multiple answers if more than one answer is true. 1. Which of the following is true?. a) UNIX (or Linux) is a widely used mail system. b) UNIX (or Linux) is case sensitive. c) UNIX (or Linux) has a graphical user interface.
E N D
CSI 135 Quiz 6
Quiz 6 • Choose multiple answers if more than one answer is true.
1. Which of the following is true? a) UNIX (or Linux) is a widely used mail system. b) UNIX (or Linux) is case sensitive. c) UNIX (or Linux) has a graphical user interface. d) All of the above are true. e) None of the above is true.
1. Which of the following is true? a) UNIX (or Linux) is a widely used mail system. b) UNIX (or Linux) is case sensitive. c) UNIX (or Linux) has a graphical user interface. d) All of the above are true. e) None of the above is true.
2. To list the permissions on files, which of the following commands will work? a) % ls b) % ls –a c) % ls –l d) % more –al e) All of the above will work.
2. To list the permissions on files, which of the following commands will work? a) % ls b) % ls –a c) % ls –l d) % more –al e) All of the above will work.
3. The file mypage.html has permissions set as "rw-------", Which of the following will change the permissions so that the file can be viewed by anyone? a) % chmodog+x mypage.html b) % chmodog+x ~ c) % chmodog+r index.html d) % chmodog+r mypage.html e) None of the above will work
3. The file mypage.html has permissions set as "rw-------“. Which of the following will change the permissions so that the file can be viewed by anyone? a) % chmodog+x mypage.html b) % chmodog+x ~ c) % chmodog+r index.html d) % chmodog+r mypage.html e) None of the above will work
4. When creating a directory, which of the following is true? a) The default permissions are: rwxr-xr-x b) You must be in your home directory. c) You use the pico Unix command to create a directory d) The directory name must end in .dir e) All of the above are true.
4. When creating a directory, which of the following is true? a) The default permissions are: rwxr-xr-x b) You must be in your home directory. c) You use the pico Unix command to create a directory d) The directory name must end in .dir e) All of the above are true.
5. The file myproc has permissions set as rwxrwxrwx. This means that: a) The file is really a directory and was named incorrectly. b) It is impossible for a directory file to have permissions set that way. c) Everyone can read, write, and execute the file. d) The file cannot be viewed on the members of the staff group. e) All of the above are true.
5. The file myproc has permissions set as rwxrwxrwx. This means that: a) The file is really a directory and was named incorrectly. b) It is impossible for a directory file to have permissions set that way. c) Everyone can read, write, and execute the file. d) The file cannot be viewed on the members of the staff group. e) All of the above are true.
6. Which command is used to create the image file mypicture.jpg? a) % mkdir mypicture.jpg b) % more mypicture.jpg c) % ls -l mypicture.jpg i) % cd mypicture.jpg e) None of the above will work.
6. Which command is used to create the image file mypicture.jpg? a) % mkdir mypicture.jpg b) % more mypicture.jpg c) % ls -l mypicture.jpg i) % cd mypicture.jpg e) None of the above will work.
7. What does the following command do? % pico README a) Creates a directory called README b) Creates a file called README.txt c) Opens the Pine mail program to read mail d) Edits an existing file called README e) None of the above are true.
8. Which of the following commands displays the full pathname of the directory you are positioned in? a) % man pwd b) % cd c) % cd ~ d) % pwd e) % ls
9. Which command always puts you in your home directory? a) % home b) % cd c) % cd .. d) % pwd e) % cd home
9. Which command always puts you in your home directory? a) % home b) % cd c) % cd .. d) % pwd e) % cd home
10. Which command will append the output of myproc to a log file? ?
10. Which command will append the output of myproc to a log file? mproc >> logfile
11. What will the following command do? % chmodugo+r *.jpg a) Change the permissions on the file *.jpg so that it is readable. b) Change the permissions on all image files so that they can be displayed. c) Change the permissions on any file that ends in .jpg in the current directory so that it is viewable by anyone. d) Change permissions on the directory so that image files can be saved in it. e) It is not a valid command because the file name contains a *.
11. What will the following command do? % chmodugo+r *.jpg a) Change the permissions on the file *.jpg so that it is readable. b) Change the permissions on all image files so that they can be displayed. c) Change the permissions on any file that ends in .jpg in the current directory so that it is viewable by anyone. d) Change permissions on the directory so that image files can be saved in it. e) It is not a valid command because the file name contains a *.
12. To rename the file named a.html to b.html, which command do you use? a) % cp b.html a.html b) % mv b.html a.html c) % cp a.html b.html d) % rename b.html a.html e) % mv a.html b.html
12. To rename the file named a.html to b.html, which command do you use? a) % cp b.html a.html b) % mv b.html a.html c) % cp a.html b.html d) % rename b.html a.html e) % mv a.html b.html
13. To delete a file called mynotes.txt, which command do you use? a) % del mynotes.txt b) % rmdir mynotes.txt c) % pico mynotes.txt d) % rm mynotes.txt e) None of the above commands will work.
13. To delete a file called mynotes.txt, which command do you use? a) % del mynotes.txt b) % rmdir mynotes.txt c) % pico mynotes.txt d) % rm mynotes.txt e) None of the above commands will work.
14. What does the ^ character match when used with grep? a) beginning of line b) end of line c) beginning of word d) end of word e) the ^ character f) any non-alphabetic character
14. What does the ^ character match when used with grep? a) beginning of line b) end of line c) beginning of word d) end of word e) the ^ character f) any non-alphabetic character
15. What Unix/Linux command would count how many lines are in the /etc/motd file? ?
15. What Unix/Linux command would count how many lines are in the /etc/motd file? wc –l /etc/motd
16. What does [a-m] represent? a) Any string of letters b) Any string of letters in the first half of the alphabet c) Any single letter in the first half of the alphabet d) Any word that starts with "a" and ends with "m" e) Any number of letters in the first half of the alphabet (e.g., abcabcabc)
16. What does [a-m] represent? a) Any string of letters b) Any string of letters in the first half of the alphabet c) Any single letter in the first half of the alphabet d) Any word that starts with "a" and ends with "m" e) Any number of letters in the first half of the alphabet (e.g., abcabcabc)
17. What expression would match any digit between 1 and 5? ?
17. What expression would match any digit between 1 and 5? [1-5]
18. What expression would match any year between 1990 and 1999? ?
18. What expression would match any year between 1990 and 1999? [1900-1999] 199[0-9]
19. What regular expression will match all three-letter file names? ?
19. What regular expression will match all three-letter file names? ???
20. What grep command would match the word "the" in a file named textfile (and not "then" etc.)? ?
20. What grep command would match the word "the" in a file named textfile (and not "then" etc.)? grep –w the textfile
21. What grep command will find any line ending with a question mark (?) in a file named textfile? ?
21. What grep command will find any line ending with a question mark (?) in a file named textfile? grep ?$ textfile
22. What grep command will display lines containing three-letter words (lowercase, no digits)? ?
22. What grep command will display lines containing three-letter words (lowercase, no digits)? grep –w [a-z][a-z][a-z]
23. What grep command will match lines that contain an uppercase A? ?
23. What grep command will match lines that contain an uppercase A? grep A
24. What grep command will match lines that contain a T whether in uppercase or lowercase? ?
24. What grep command will match lines that contain a T whether in uppercase or lowercase? grep [Tt]
25. What happens when you type this command in Unix and why? echo Do not pass go. Do not collect $200.
25. What happens when you type this command in Unix and why? echo Do not pass go. Do not collect $200. $2 is interpreted as a variable/argument and has no value, so you see “Do not collect 00”.