Midterm Test #2 Answers Test #2 - Points: 62 (15 of 25%) 1. [Points: 1] Give the dotted-quad network mask for this subnet: 1.1.1.0/26 255.255.255.192 2. [Points: 2] What is the next sub-net address numerically greater than: 2.2.2.0/25? 2.2.2.128 3. [Points: 2] What is the next sub-net address numerically greater than: 9.9.9.0/24? 9.9.10.0 4. [Points: 4] Give any two of the three RFC1918 private address space blocks and masks. 10/8 172.16/12 192.168/16 5. [Points: 1] What command shows and sets the IP address and network mask of each network interface? ifconfig 6. [Points: 3] I want my computer to talk to another computer on a different network from mine. What minimum network configuration do I need? IP addr, net mask, gateway 7. [Points: 3] Fix the quoting in this shell command line so that the sentence appears on the screen as written: echo I'm buying "environmental" stock. echo "I'm buying \"environmental\" stock." echo "I'm buying "'"environmental"'" stock." echo I\'m buying \"environmental\" stock. 8. [Points: 1] Which kind of shell quotes protect most strongly? single ' 9. [Points: 1] What is the name of the program that you can use to manually set the system clock before calling the NTP time server program? ntpdate 10. [Points: 1] Give the absolute pathname of the start- up script for the ntp-server time server package: /etc/init.d/ntp-server 11. [Points: 1] Write the assignment that would set your shell's PATH variable to be the three directories /bin, /usr/bin, and /sbin. PATH=/bin:/usr/bin:/sbin 12. [Points: 2] Write a command to extract the third space-delimited word from every line in a file named foo: awk '{print $3}' foo 13. [Points: 3] Write a command pipeline to extract just line 7 from a file named foo: head -7 foo | tail -1 14. [Points: 5] Write a command pipeline to extract just the third space-delimited word from line 7 of a file named foo: head -7 foo | tail -1 | awk '{print $3}' 15. [Points: 1] What kind of shell expansion does double- quoting your $variables prevent? file GLOB (wildcards) 16. [Points: 2] What command shows all processes for all users? ps ax -or- ps -e 17. [Points: 2] Write a command that creates a symbolic link in /tmp/foo that contains the path bar: ln -s bar /tmp/foo 18. [Points: 4] Rewrite and fix all the errors in this shell IF statement: if 5 > 3 print it's five that is bigger endif if [ 5 -gt 3 ]; then echo "it's five that is bigger" ; fi if test 5 -gt 3 ; then echo it\'s five that is bigger ; fi 19. [Points: 1] A Unix/Linux tar file is an archive of individually compressed files: FALSE 20. [Points: 1] Give the absolute path of the config file that controls Unix/Linux system logging: /etc/syslog.conf 21. [Points: 1] Give the absolute path of the usual directory where log files are kept: /var/log/ 22. [Points: 1] Give the absolute path of the directory containing the master copy of all the system start-up scripts: /etc/init.d/ 23. [Points: 1] Give the absolute path of the directory containing the start-up script symlinks for run level 3: /etc/rc3.d/ 24. [Points: 1] Give the absolute path of the file name that lists and sets run levels: /etc/inittab 25. [Points: 1] What does the prefix letter S mean on a start-up script symlink in a run-level directory? Run this script with a "start" argument at boot time. 26. [Points: 1] What command displays all possible network interfaces and their statistics? ifconfig -a -or- netstat -ai 27. [Points: 1] What command changes the current run level in a running system? telinit 28. [Points: 2] How can you arrange that a start-up script is always started when the system enters, say, run level 3? link the start up script from /etc/init.d/foo to /etc/rc3.d/S55foo 29. [Points: 2] What command fetches and installs a package on a Debian system? apt-get install 30. [Points: 1] What is absolute pathname of the principal network config file for Debian systems? /etc/network/interfaces 31. [Points: 1] What is the absolute pathname of the system start-up script for networking on a Debian system? /etc/init.d/networking 32. [Points: 1] What command shows the default gateway? ip route -or- route 33. [Points: 1] Give the absolute path of the file in which the list of DNS servers is kept: /etc/resolv.conf 34. [Points: 1] You must start/stop the network to make changes in DNS servers visible: FALSE 35. [Points: 2] What is the purpose of a "gateway" IP address? route packets to non-local networks 36. [Points: 2] How does using the ifconfig command affect the routing table? a route is automatically added for the interface being configured 37. [Points: 1] The best time to synchronize your system clock is at midnight, when other time servers are most accurate: FALSE Test #2 15 of 25% NET2003 80 minutes