CIS 90 - Spring 2014 - TEST 1 - 30 points HONOR CODE: This test is open book, open notes, and open computer. HOWEVER, you must work alone. You may not discuss the test questions or answers with others during the test. You may not ask or receive assistance from anyone other than the instructor when doing this test. Likewise you may not give any assistance to anyone taking the test. 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. Everyone should submit their test (completed or not) by the end of class. If you need extra time, you can submit again by no later than 11:59PM. Only the last submittal will be graded. Linux servers used for this test: 1) oslab.cishawks.net (port 2220) - this server is also called Opus 2) sun-hwa-ii.cishawks.net (port 22) 3) razia.cishawks.net (port 22) 4) pxx-arwen.cishawks.net (port 22) - used for an extra credit question All servers are accessible using ssh from Opus. For Sun-Hwa-II and Razia 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 Razia server to answer the following questions ] [ ------------------------------------------------------------ ] Q1) Let's plant the flag on Razia. Login to Razia 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 Razia? 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-II server to answer the following questions ] [ ------------------------------------------------------------ ] Q4) Log into Sun-Hwa-II and run the flag command. What is the output of this command? A4) Q5) What kernel release is running on Sun-Hwa-II? Is this newer or older than the one on Razia? [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-II? A7) Q8) What is the value of the PS1 variable on Sun-Hwa-II? A8) Q9) Cat the file named "commands" (without the quotes) in your home directory on Sun-Hwa-II. 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-II. What is the ABSOLUTE pathname of the REGULAR file referenced by this symbolic link file? A11) Q12) Who owns the file referenced by that symbolic link? A12) Q13) In your home directory on Sun-Hwa-II 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 LONG LISTING of all these files sorted by file SIZE? (hint: your answer should produce 34 lines of output) A15) Q16) On Sun-Hwa-II, 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-II? A17) Q18) What distro is running on Sun-Hwa-II? A18) Q19) When the command: "ls -Fal /usr/bin/[ac]*h??" (without the quotes) is run on Sun-Hwa-II, 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-II? A20) Q21) Of all the files represented by /usr/share/doc/*/LICENSE, which has a file size of 4816 bytes? 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 "zdog zcat" what 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 "zcat zdog" which program outputs the resulting error message? A23) Q24) On Sun-Hwa-II, examine the directories on your path. How many of those directories must the shell search to find the useradd command? A24) Q25) On Sun-Hwa-II, the uname command has been compromised by the others on the island! What is the name of the DIRECTORY where the uname command is found? A25) Q26) Parse this command: "file -blN /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) Lab2.0 directory. From there, what single command using an ABSOLUTE pathname would do a hex dump of the banner file in YOUR bin directory? A27) Q28) Of the files in the /etc/makedev.d/ directory whose names contain the letters b, c, d, or m which are FORTRAN program files? A28) Read your mail on Opus. What is Benji's favorite game? A29) Q30) On Opus calculate using bc: 12 * (9^4 + sqrt(289)) /32 - 452 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 #3 on your VM and login as cis90. Virtual terminals are very basic with no scroll bars and have a black background. Make sure you are on the 3rd virtual terminal. What is the output of the "ls -i $(tty)" (without the quotes) command? A31) Q32) On Sun-Hwa-II look at the files in Ana Lucia Cortez's home directory. One of them is a symbolic link. View the first 11 lines of the file referenced by the symbolic link. What is the complete 11th line of that file? A32) Q33) On Sun-Hwa-II, figure out which shell Danielle Rousseau uses. Now do a little research on that shell. What was the first and last name of the person at Bell Labs that developed it? 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.