Assignment 7 -- Linux Commands - Find and Redirect
|
The objective of this assignment is to give you the opportunity to
prove you can use the commands we went over in class. To accomplish
this you will follow the instructions listed below:
|
|
While in your home directory, write a script (macro) called find-fun that performs
the following steps:
-
Every command will send output to the screen AND to a file named
console-surveillance.txt (appending to the file with each new command)
-
Use a command to find where the PASS_MAX_DAYS variable is set on
your Linux computer. Your output should just list the target file --
if other files are being listed try to eliminate them
-
Run the command that will output the first 2 lines on this file
-
Run the command that will output the last 2 lines on this file
-
In the same directory (where the last file was found) list all files
starting with "host" -- use the long listing format
-
Use a command to find the file that shows the name of your computer
-
Run the command that counts how many lines are in that file (just
the lines nothing else)
-
Use a command to make your name appear on the screen
|
**NOTE** Some of you will be tempted to write a script that does everything in
sequence and I will give extra credit for this but it is not a requirement. Do the
commands outside the script first to see how they work. Add them to the script one
by one. This is easier and I do not want you not to turn in the assignment because
it was too difficult.
|