Note: Some questions say, "Show your work!" For those questions include a concise copy/paste of text showing the command(s) you executed to answer the question. Don't include experiments and errors. Work out a sequence that answers the question and show only that sequence. ------------------------------ Question (1/2 point) ------------------------------ Do wildcards work in a command name? Show your work! Answer: ------------------------------ Question (1/2 point) ------------------------------ How many classes are in the Java archive /usr/local/jdk/jre/lib/rt.jar? Show your work! Answer: ------------------------------ Question (1/2 point) ------------------------------ How many lines are in the assembly language file produced by compiling fall15/c/iota.c with the -S option? Show your work! Answer: ------------------------------ Question (1/2 point) ------------------------------ How many static methods are in java.lang.String? Show your work! Answer: ------------------------------ Question (1/2 point) ------------------------------ When you type a command like "ls", where does bash first look for ls? In your aliases or in directories on your PATH? Show your work! Answer: ------------------------------ Question (1/2 point) ------------------------------ What's the relationship between object files produced by as(1) and object-oriented programming? Answer: ------------------------------ Question (1/2 point) ------------------------------ At most, how many files could be matched with the following wildcard pattern? [ab][cde][fghi] Answer: ------------------------------ Question (1/2 point) ------------------------------ If I do 'ls [a][b][c]' in an empty directory, what arguments is ls called with? Answer: ------------------------------ Question (1 point) ------------------------------ What is whm wanting to see when he types "pzr"? Answer: ------------------------------ Question (1 point) ------------------------------ Where can spaces be added to a line like '#include '? Show your answer by adding spaces to the #include line that follows "Answer:". Answer: #include ------------------------------ Question (1 point) ------------------------------ Comments in C11 are just like Java: // is comment to end of line and /* ... */ comments out the enclosed text. Show an experiment that answers this question: Does the C preprocessor remove comments? Answer: ------------------------------ Question (1 point) ------------------------------ How many zero-length lines does gcc -E fall15/c/iota.c produce? Show your work! Hint: 'cut -c1' might help with this. Answer: ------------------------------ Question (1 point) ------------------------------ What does 'cd -' do? Answer: ------------------------------ Question (1 point) ------------------------------ Imagine that all the files in the current directory are license plate "numbers". Write a pipeline that outputs the count of license plates that are either three capital letters followed by four digits (like PDQ1097) or three digits followed by three capital letters like (078DNS). Note: You may not use regular expressions! Example: For a directory containing these files, % ls 078DNS CPM29 PDQ1097 XYZ123 The pipeline would output 2. Answer: ------------------------------ Question (1 point) ------------------------------ Write two mv commands to perform these two operations: Move all files in the current directory whose names start with a lower case vowel into a directory named V. Move all directories starting with a lower case consonant into a directory named C. Vowels are aeiou. Exception: Files that start with an "x" should be left in place. Answer: ------------------------------ Question (1 point) ------------------------------ Consider this question: "There are a million files in the current directory. Write a single rm command that will remove all files whose names are all capitals." If you know only the wildcards covered in class, what makes that question hard to answer? Answer: ------------------------------ Question (1 point) ------------------------------ Imagine you overheard this question and answer: "How I can edit my .vimrc?" "cd to your home directory and then do 'vim .vimrc'" What's a shorter, better answer? Answer: ------------------------------ Question (2 points) ------------------------------ A friend thinks that 'fgrep *x* *.java' is looking for occurrences of x in their Java files. Explain what that command actually does. Keep in mind that any directory might or might not have files whose names contain an 'x'. Note: This is a 2-pointer. It requires some work and thought. Answer: