1 / 59

Quiz 6

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.

dieter
Télécharger la présentation

Quiz 6

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. CSI 135 Quiz 6

  2. Quiz 6 • Choose multiple answers if more than one answer is true.

  3. 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.

  4. 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.

  5. 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.

  6. 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.

  7. 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

  8. 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

  9. 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.

  10. 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.

  11. 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.

  12. 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.

  13. 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.

  14. 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.

  15. 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.

  16. 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

  17. 9. Which command always puts you in your home directory? a) % home b) % cd c) % cd .. d) % pwd e) % cd home

  18. 9. Which command always puts you in your home directory? a) % home b) % cd c) % cd .. d) % pwd e) % cd home

  19. 10. Which command will append the output of myproc to a log file? ?

  20. 10. Which command will append the output of myproc to a log file? mproc >> logfile

  21. 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 *.

  22. 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 *.

  23. 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

  24. 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

  25. 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.

  26. 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.

  27. 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

  28. 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

  29. 15. What Unix/Linux command would count how many lines are in the /etc/motd file? ?

  30. 15. What Unix/Linux command would count how many lines are in the /etc/motd file? wc –l /etc/motd

  31. 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)

  32. 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)

  33. 17. What expression would match any digit between 1 and 5? ?

  34. 17. What expression would match any digit between 1 and 5? [1-5]

  35. 18. What expression would match any year between 1990 and 1999? ?

  36. 18. What expression would match any year between 1990 and 1999? [1900-1999] 199[0-9]

  37. 19. What regular expression will match all three-letter file names? ?

  38. 19. What regular expression will match all three-letter file names? ???

  39. 20. What grep command would match the word "the" in a file named textfile (and not "then" etc.)? ?

  40. 20. What grep command would match the word "the" in a file named textfile (and not "then" etc.)? grep –w the textfile

  41. 21. What grep command will find any line ending with a question mark (?) in a file named textfile? ?

  42. 21. What grep command will find any line ending with a question mark (?) in a file named textfile? grep ?$ textfile

  43. 22. What grep command will display lines containing three-letter words (lowercase, no digits)? ?

  44. 22. What grep command will display lines containing three-letter words (lowercase, no digits)? grep –w [a-z][a-z][a-z]

  45. 23. What grep command will match lines that contain an uppercase A? ?

  46. 23. What grep command will match lines that contain an uppercase A? grep A

  47. 24. What grep command will match lines that contain a T whether in uppercase or lowercase? ?

  48. 24. What grep command will match lines that contain a T whether in uppercase or lowercase? grep [Tt]

  49. 25. What happens when you type this command in Unix and why? echo Do not pass go. Do not collect $200.

  50. 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”.

More Related