Sie sind auf Seite 1von 2

Linux Final Study Guide

For your Linux final, you will be asked to perform a series of tasks from the command line.

• You will have 55 minutes to complete the exercise


• You will be allowed to use notes and any online sources you can find. However, you won’t
have time to look more than one or two things up. If you need to refer to these notes often,
then you are not prepared enough
• The tasks will assume you are familiar with the following tools and utilities: cd, mkdir,
passwd, rm, mv, man, less, vi, java, javac, bg, ln, grep, cat, pwd, ssh,
chmod, tr, cut, sort, uniq, and cp.
• You should also know how to do the following:
o Compile and run a Java program from the command line (even if some of the parts are
in other directories).
o Redirect the input and output of a process to/from a file.
o Pipe info from one process to another (e.g., ls | grep).
o Run a process in the background. (e.g., ./runMe &).
o Kill a process (both foreground and background).
o Use ps to list currently running processes.
o Use wildcard symbols to identify several files (for copying, compiling, deleting, etc).
o Send files to the printer in the EOS lab.
o Use the files “.” and “..”.
o Understand the difference between absolute and relative paths.
o Write shell scripts with variables and loops.
o Set the permissions of files as desired.
o Use ssh to log into a machine remotely.
o Use ssh to run a command on a remote machine.
o Use the man pages to learn how to use a new utility.
o Answer any questions from the “Common Utilities” EOS Tutorial.
o Answer any wildcard-related questions from the “Filesystem Basics” EOS Tutorial.
o Answer any questions from the “Job Control” EOS Tutorial.
o Know what “hidden files” are and how to see them.
Sample Final

You will perform a series of common tasks and write the correct syntax of each command. Given
limited time, you will need to be well prepared and able to move quickly. Here is a brief sample of
tasks but your mission will be more extensive.
Complete the following sequence of actions inside a new terminal window. Unless specified
otherwise, you must complete each task using at most one command (or several commands piped
together). If you cannot quickly determine how to perform a task then move on to the next one.
1. Create a directory named PracticeFinal.
2. Use a single command to create a directory named innerDir inside PracticeFinal.
3. Copy all the files from /home/kurmasz/public/CS163/PracticeFinalFiles to
your PracticeFinal.
4. Inside PracticeFinal/sampleFiles, you fill find several files whose names and
content have an obvious pattern. Write a shell script that will generate a similar set of files and
place them in innerDir.
5. From the directory PracticeFinal, use relative path names and the diff command to
compare the versions of file1 in sampleFiles and innerDir.
6. Now, repeat problem #5, but use absolute path names.
7. Move into innerDir and repeat problem 5.
*). Move into the PracticeFinal directory.
8. The file sampleScript is a perl script. You can run it with this command:
perl sampleScript. Make the necessary changes so that you can run it directly from the
command line like this: ./sampleScript.
9. Use ssh to run sampleScript on eos24. You will need to use a full path name to refer
to the script.
10. Each of Lady Macbeth’s speaking parts comprises several lines of text in macbeth.txt.
Use the grep command, and only the grep command, to print the first 3 text lines of each of
Lady Macbeth’s speaking parts. Hint: Use the man pages.
11. Give the full path name of the file that is executed when you run javac from the command
line.
12. Review the Practice Linux Quiz.

Short answer questions:


• What are environment variables?
• When you type javac at the command line, how does the shell know which program to run?

Das könnte Ihnen auch gefallen