% ls -al.
Exercise 5: Try each of the above ways to list
directory info. Try the directory /home/vastro/tutorial. Which do you
prefer? What situations do you think
are better suited to the different flavors of ls?
First try just ls -l and then ls -al on the directory
/home/vastro/tutorial/texts. Did you see anything more with the latter
command than the former?
For example, in the directory /home/vastro/tutorial/examples,
% file Uhuru.txt
Uhuru.txt: ASCII text
% file unixt.ps
unixt.ps: PostScript document
% file xboard-3.6.2.tar.Z
xboard-3.6.2.tar.Z: compressed data block compressed 16 bits
% file w3browse-16280.tar
w3browse-16280.tar: USTAR tar archive
%
For example, in the directory /home/vastro/tutorial/texts,
% cat riddle.txt
At night they come without being fetched,
And by day they are lost without being stolen.
What are they?
%
For example
% tail -2 riddle.txt
And by day they are lost without being stolen.
What are they?
%
Exercise 6: Use each of cat, more and
tail to view all the text files in the directory texts. Which was more
useful for which files?
Question 6: What is the difference between
the commands more , cat, and tail?
For example,
% grep stolen riddle.txt
And by day they are lost without being stolen.
%
Exercise 7: Use grep to find the word `planet'
in drake.txt. This file is located in the diretory
tutorial/texts. Is `planet' found in any of the other files in
this directory?
For example, (you can find lightcurve.ps in the directory
/home/vastro/tutorial/ps.)
% compress -v lightcurve.ps
lightcurve.ps: Compression: 71.74%
For example (w3browse-16280.tar can be found in the directory
/home/vastro/tutorial/examples.)
% tar -xvf w3browse-16280.tar
x me/rates/d/d45390.lc.Z, 5728 bytes, 12 tape blocks
x me/rates/d/d45397.lc.Z, 6048 bytes, 12 tape blocks
x me/rates/d/d45404.lc.Z, 6455 bytes, 13 tape blocks
x me/rates/d/d45413.lc.Z, 7381 bytes, 15 tape blocks
%
creates the subdirectory tree me/rates/d, and place all the files
ending with .lc.Z
in subdirectory d.
![]() |
Question 7: What are the fundamental uses of compressing and taring?
Exercise 8: Remember the file .objects.tar you
found in the directory
/home/vastro/tutorial/texts? Go to that
directory and use tar to extract the contents of this file.
How many directories and files did you extract? What can you say about
each of the files you extracted?