Unix Exercises
Do the following exercises in your ruby.ils.unc.edu account.
-
Create a directory named "ex1" and copy the following
two files into it. Try using a wildcard character
to copy both files at once.
/htdocs/courses/2010_spring/inls760_001/ex1/sample1.txt
/htdocs/courses/2010_spring/inls760_001/ex1/sample2.txt
-
Read the man page for the Unix uniq command.
Use the sort and uniq commands along with the pipe operator
to write a one-line statement that will list all the
lines that appear in both sample1.txt and sample2.txt
(i.e. the intersection of the two files).
-
Do the same as above, execpt instead of showing the intersection
of the two files on the screen, write the lines out to a file
called overlap.txt
-
Set the permissions on the overlap.txt file so that
you can read and write the file, users in your group can
read the file, and all other users of the system
cannot read or write the file. No other permissions
should be set.
|