In this assignment, you will demonstrate some basic Unix commands by
performing some simple tasks. To begin this assignment,
look at the files located
in the ~cs155/pub/hw2Files
directory. The files contain
information about people. For each person there are four files.
For example, Sam would have the following four files:
                
sam.grades
;
).sam.info
sam.jpg
sam.log
Your primary objective in this assignment is to use your knowledge of Unix commands to collect and manipulate data contained in these files. For each of the problems listed below, you should give the command(s) you used. I want to see the commands, not the output of those commands.                 
Place your answers in a file named simple
, and submit it for HW2.
It must not be called “hw2”. You may use nano to generate your
submission, or any other editor that you prefer. Your submission should
be formatted as follows, with blank lines between parts:
                
1 command command 2 command command 3 command 4 ... etc.
This time the grading is a little different: The difficulty of the questions vary. Some problems require multiple steps and some require complex commands. Each problem specifies a number of commands; you will be penalized for submitting an answer that uses more commands than were specified.                 
cat foo
cat foo | cut -c' ' -f 2 | sort
cat foo; date
cat foo date
––––––––––––––––
Unless otherwise specified, assume that you start this assignment in your home directory. Assume that after each question you return to your home directory. A few of these problems will require some thought. Try to break the problems into individual commands and test out your ideas before assembling commands together. Good luck.                 
.info
OR .log
?)
substandard
in your home directory that contains
the file names and lines (the data, not the line numbers) in the grades files
where students scored less than ten out of a hundred.
data
in your home directory.
Copy all info
files into this directory.
~cs155/pub/hw2Files/
directory.classes
in your home directory with a list of all
the classes taken by anyone (e.g. classes listed in all grades files).
Look at the manual page for cut, and be sure to use quotes on your delimiter.classes
,
just display the results.
fire
in your home directory with a listing of all people who logged in on July 4th 2006.
.log
files and search for anyone with an entry
for the date specified.
~cs155/pub/hw2Files
directory. log.info
in your home directory containing two
columns, where the first column is the number of times the person
has been logged and the second column is the person’s name
(use cut to remove the .log
from the output). 1 jane 1 jill 1 matilda 1 mati 1 sally 1 sam 1 wilma 3 george 4 alex 5 fred 7 gerry 7 jack 11 mary 44 total
It doesn’t matter whether mati
or matilda
comes first.
                
~
)
and not some giant hideous path that starts with /s/
.
If you use a giant hideous path instead of using tilde, you will
lose points. This means that you have to use quotes properly.
Consider this, which produces bad results in the file x
,
and good results in the file y
.
% echo Go home: cd ~ >x % echo "Go home: cd ~" >y % cat x Go home: cd /s/parsons/d/fac/applin % cat y Go home: cd ~
jack.log
,
it would not be acceptable to cat jack.log
, look at the results,
count the lines on your fingers, and then turn in the command echo 7
.
Yes, that command produces the same results, but that command doesn’t
actually do the counting—you did.
~cs155/bin/checkin HW2 simple
Follow the directions on the homework page.                 
Turn in someone else’s work.                 
Modified: 2017-08-26T16:35                  User: Guest                  Check: HTML CSSEdit History Source |
Apply to CSU |
Contact CSU |
Disclaimer |
Equal Opportunity Colorado State University, Fort Collins, CO 80523 USA © 2015 Colorado State University |