=========================preview======================
(COMP111)comp111_01f_midterm_sol.pdf
Back to COMP111 Login to download
======================================================
COMP111:.Software.Tools..
Midterm.Exam.C.Qiang.Yang..
Fall..2001.(Wed..Oct.10,.2001.12:00-14:00).. .. .. ..
Student.Name:._______________________________________________..
..
Student.Number:._____________________________________________..
..
Email:.______________________________________________________..
..
Lab.Section:.________________________________________________..
..

.. Instructions:..
.. 1..There.are.12.problems.worth.100.points.total... .. 2..Check.that.you.have.all.7.pages... .. 3..Close.book,.close.notes,.work.on.your.own,.and.you.cannot.use.any.computer... .. 4..Answer.all.questions.in.the.space.provided..Rough.work.can.be.done.only.on.the.back. pages... .. 5..Leave.all.pages.stapled.together... .. 6..The.examination.period.will.last.for.120.minutes... ..
7..Stop.writing.immediately.when.the.time.is.up... .. ..
For.Grading.Purposes.Only:.. ..
Problems.1______________./.20.
Problems.2...______________./.5..
Problems.3...______________./.5..
Problems.4...______________./.5..
Problems.5...______________./.5..
Problem..6....______________./.5..
Problems.7.....______________./.5..
Problems.8...______________./.5..
Problem..9....______________./.8..
Problems.10.....______________./.7..
Problems.11...______________./.15.
Problems.12...______________./.15.
.
Total:...______________./100..

... . . 1)..(20.points)..Use.a.single.command.to.satisfy.your.requirement...The.command.must.work. whatever.your.current.working.directory.and.home.directory.are..
.
1.1...List.the.last.5.lines.of.the.file.letter1.in.the.current.working.directory... tail..C5.letter1.. 1.2...Append.a.file.f1.to.another.file.f2..(assume.both.files.are.in.the.current.working.directory).. cat.f1.>>.f2..
1.3...List.the.names.of.all.the.files.in.the.current.directory.that.begin.with.a.letter.and.ends.with. extension..txt.
ls.[a-zA-Z]*.txt..

1.4...Delete.the.file.tmp.$$$.in.the.parent.directory.of.your.current.working.directory..
rm.../tmp.\$\$\$..

or,.rm.'../tmp.$$$'.. 1.5...Copy.the.whole.subdirectory.tree.of.your.home.directory.to.a.new.one.called.backup. (assuming.backup.exists,.and.both.in.the.current.directory)...
cp.CR.~.backup...(or.Cr).. 1.6...Delete.the.whole.subdirectory.tree.test.in.your.home.directory.. rm.CR.~/test.(or.Cr).. 1.7...Add.a.user.account.called.peter.if.you.are.the.administrator.(root).. useradd.peter..
1.8...Change.your.own.password...
passwd... 1.9...Delete.a.group.called.comp111..if.you.are.the.administrator.(root)... groupdel.comp111.. 1.10...Add.jane.to.the.group.comp111..if.you.are.the.administrator... usermod.-G.comp111.jane.. 1.11...List.only.the.information.of.the.group.comp111. ypcat.group.|.grep.comp111.. 1.12.. find.all.lines.in.the.file.names.that.do..not.contain.a,.or.b,.or.c.. grep.Cv.[a,b,c].names.
1.13...List.all.the.mounted.file.systems.in.your.UNIX.computer..
df..

1.14...List.the.disk.usage.statistics.in.number.of.blocks.for.all.subdirectories.in.t