CIS 90 - Spring 2014 - PRACTICE TEST 1 - 30 points HONOR CODE: This is a practice test and you may work with others on it. However on the real test you must work alone. Submit the practice test even though it's not graded to verify you know how to do it correctly. Feel free to compare and discuss answers to the practice test on the forum. NAME: <<< please replace this text with your name >>> INSTRUCTIONS: Download or copy and paste this page from your web browser into a text file on your computer. Don't use a word processor like MS Word! Instead use a text editor like Notepad (Windows) or TextWrangler (Mac) to add your answers to the questions below. Linux servers used for this test: 1) oslab.cishawks.net (port 2220) - this server is also called Opus 2) sun-hwa.cishawks.net (port 22) 3) son-of-opus.simms-teach.com (port 2220) 4) pxx-arwen.cishawks.net (port 22) - used for an extra credit question All servers are accessible using ssh from Opus. For Sun-Hwa and Son-of-Opus login using your original Opus credentials. For Arwen, use the generic cis90 account. Please KEEP YOUR ANSWERS TO A SINGLE LINE ONLY and preserve the tags, e.g. "A1)", "A2)", etc. used to label the answers. [ ------------------------------------------------------------ ] [ Use the Son-of Opus server to answer the following questions ] [ ------------------------------------------------------------ ] Q1) Let's plant the flag on Son-of-Opus. Login to Son-of-Opus and run the flag command. What is the output of this command? A1) Q2) In March 2003, the kernel release for the popular Red Hat 9 distro was 2.4.20-8. The kernel release on Opus is 2.6.32-220.23.1.el6.i686. You can download the source code for any release from www.kernel.org. What kernel release is running on Son-of-Opus? A2) Q3) Running the flag command creates a new file called geocache. View the contents of this file to discover the name of a mystery file assigned to you. Examine your mystery file. How many LINES does your mystery file have? A3) [ ------------------------------------------------------------ ] [ Use the Sun-Hwa server to answer the following questions ] [ ------------------------------------------------------------ ] Q4) Log into Sun-Hwa and run the flag command. What is the output of this command? A4) Q5) What kernel release is running on Sun-Hwa? Is this newer or older than the one on Son-of-Opus? [put both answers below on one line please] A5) Q6) After running the flag command view the contents of geocache file in your home directory. Discover the name of the mystery file assigned to you. Examine your mystery file. How many WORDS are in your mystery file? A6) Q7) What is the shell prompt (the actual text printed) on Sun-Hwa? A7) Q8) What is the value of the PS1 variable on Sun-Hwa? A8) Q9) Cat the file named "commands" (without the quotes) in your home directory on Sun-Hwa. Of the three commands listed, which are on your path? A9) Q10) One of those commands is your name. Find where the command named after you is located. What is the ABSOLUTE pathname of the DIRECTORY that contains this command? A10) Q11) Look for a symbolic link file in your home directory on Sun-Hwa. What is the ABSOLUTE pathname of the REGULAR file referenced by this symbolic link file? A11) Q12) Who owns the REGULAR file referenced by that symbolic link file? A12) Q13) In your home directory on Sun-Hwa find the sub-directory named Start. Change into that subdirectory and keep descending till you can't go down any further. What are the names of the TWO regular files in that bottom most directory? A13) Q14) Regarding those two regular files in the bottom directory, what is the inode number of the one that is hidden? A14) Q15) Regarding the non-hidden regular file in the bottom directory, all CIS 90 students have a file with the same name nested the same way in their home directories. From your home directory, what single command could you use to do a single LONG LISTING of all these files sorted by file SIZE? (hint: your answer should produce 34 lines of output) A15) Q16) On Sun-Hwa, there is a file named passwd which resides in the /etc directory. What is the ABSOLUTE pathname of this file? A16) Q17) What is your UID (User ID) number on Sun-Hwa? A17) Q18) What distro is running on Sun-Hwa? A18) Q19) When the command: "ls -StZ /usr/bin/a[bt]*e??" (without the quotes) is run on Sun-Hwa, how many arguments are passed by the shell to the ls command to process? A19) Q20) What is the name of the shell you are running on Sun-Hwa? A20) Q21) Of all the files represented by /usr/share/doc/*/README, which has a modification date of September 25, 2006? A21) Q22) When commands are entered on UNIX/Linux systems both the shell and the command work as a team to process what the user types. If you enter the command "grn green" which program complains and outputs the resulting error message? A22) Q23) Continue to think about the team effort between the shell and the command. If you enter the command "green grn" which program outputs the resulting error message? A23) Q24) On Sun-Hwa, examine the directories on your path. How many of those directories must the shell search to find the flag command? A24) Q25) On Sun-Hwa, the tty command has been compromised by the others on the island! What single command can you issue to fix this annoying behavior so you don’t have to type the name of the command backwards for it to work properly? A25) Q26) Parse this command: "ls -ltF /lib/modules/3*/v???" (without the quotes). How many options are there? What does the second option do? [put both answers below on one line please] A26) [ ------------------------------------------------------------ ] [ Use the Opus server to answer the following questions ] [ ------------------------------------------------------------ ] Q27) Change into Benji's (the simben90 user's) Miscellaneous directory. From there, what single command using a RELATIVE pathname would print just the last line of YOUR sonnet17 file in YOUR Shakespeare directory? A27) Q28) Which files in the /boot directory on Opus are kernel files? A28) Q29) Read your mail on Opus. What is Benji's favorite food? A29) Q30) On Opus calculate using bc: 1+2*(11^7+sqrt(289))-(38^5-9100*4430)-52119 and email the answer to rsimms using the mail command. [ ------------------------------------------------------------ ] [ EXTRA CREDIT ] [ ------------------------------------------------------------ ] Q31) Enter VLab and select your assigned Pxx-Arwen VM. Power it on if necessary. In VMware, open a console to view your VM's screen. Using the special keystrokes, open virtual terminal #5 on your VM. If you find you are logged in already then exit to logout. Virtual terminals are very basic with no scroll bars and have a black background. Make sure you are on the 5th virtual terminal. Right above the login prompt, what is the complete, exact, line of text printed at the top of the virtual terminal? A31) Q32) On Sun-Hwa in your home directory, what single command, using a RELATIVE pathname as an argument, would print the first line of all files in CIS 90 student home directories that start with the letter a, g or e, are exactly 8 letters long and end with the letter e? A32) Q33) On Sun-Hwa, what is Ana Lucia Cortez's plan? A33) [ ------------------------------------------------------------ ] [ Submit this test ] [ ------------------------------------------------------------ ] When finished, copy and paste everything into an email to: rsimms@oslab.cabrillo.edu (that's my email address on Opus) and include yourself as a recipient so you have a time-stamped record of your submittal.