Changes

Jump to: navigation, search

OPS235 Lab 3

57 bytes added, 07:53, 21 June 2016
no edit summary
#Boot up your '''centos3''' VM.
#Change your working directory to '''/usr/share/doc/sudo*'''
#Use the tar (tape archiver) command to create an archive file named '''/tmp/archive1.tar'''#*: <b><code><span style="color:#3366CC;font-size:1.2em;">tar cvf /tmp/archive1.tar .</span></code></b>
{{Admon/important | Warning! | Don't miss the <code>.</code> at the end of the <code>tar</code> command (where indicated). It specifies what should go into the archive: the contents of the current directory.}}
<li value="4">What do the options '''c''', '''v''', and '''f''' mean?</li>
<li>Record the archive file size.</li>
<li>Compress the file using '''gzip'''by issuing the command: <ul> <li><b><code><span style="color:#3366CC;font-size:1.2em;">gzip /tmp/archive1.tar</span></code></b></li> </ul> </li>
<li>Record the archive file size after compression.</li>
<li>Make sure you're still in '''/usr/share/doc/sudo*''' and then create a compressed archiveby issuing the following command:<ul> <libr><b><code><span style="color:#3366CC;font-size:1.2em;">tar cvzf /tmp/archive2.tgz .</span></code></b></li> </ul> </li>
<li>What does the''' z''' option do?</li>
<li>Compare the sizes of '''/tmp/archive1.tar.gz''' and '''/tmp/archive2.tgz'''. Why are they so close in size?</li>
#Change to the '''/tmp/extract1''' directory.
#Move the file '''archive1.tar.gz''' to your current directory.
#Unzip the first archive you createdby issuing the command:#*<b><code><span style="color:#3366CC;font-size:1.2em;">gunzip archive1.tar.gz</span></code></b>#Extract the files from the first archiveby issuing the command:#*<b><code><span style="color:#3366CC;font-size:1.2em;">tar xvf archive1.tar</span></code></b>
#Are all the files there?
#Compare '''/tmp/extract1/README''' and '''/usr/share/doc/sudo*/README'''. Are they exactly the same? Why?
#Create the directory '''/tmp/extract2'''
#Move the file '''archive2.tgz''' to the '''/tmp/extract2''' directory.
#Extract the files from the second archiveby issuing the following command:#*<b><code><span style="color:#3366CC;font-size:1.2em;">tar xvzf /tmp/extract2/archive2.tar.gz</span></code></b>
#Note that this time a separate <b><code><span style="color:#3366CC;font-size:1.2em;">gunzip</span></code></b> command was not needed. Why?
#Repeat the previous command, leaving out the option '''z'''. Does it work? Why?
13,420
edits

Navigation menu