Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using the terminal (UNIX), complete the following tasks: Create a directory tree with following structure: ~/resume2 ~/resume2/dira/a.txt ~/resume2/dira/b.txt ~/resume2/dirb ~/resume2/dirb/c.txt ~/resume2/dirc ~/resume2/dirc/dird ~/resume2/dirc/dird/d.txt Edit the

Using the terminal (UNIX), complete the following tasks:

  1. Create a directory tree with following structure:

~/resume2

~/resume2/dira/a.txt

~/resume2/dira/b.txt

~/resume2/dirb

~/resume2/dirb/c.txt

~/resume2/dirc

~/resume2/dirc/dird

~/resume2/dirc/dird/d.txt

  1. Edit the text files, a.txt, b.txt, c.txt, d.txt to contain the contents described for each, below:

a.txt

This is file a.txt

b.txt

This is file b.txt

c.txt

This is file c.txt

d.txt

This is file d.txt

  1. Change your working directory to your home directory (there should be an resume2 directory there) and use tar to create a .tar.gz file containing the resume2 directory and all of its subdirectories and files. Hint: use a command resembling tar czf somefile somedir to create the tarball
  2. Create a temporary directory and cd into it. Then extract the tarball you just created in this directory. For example:

mkdir tdir

cd tdir

tar xvf ../niftytar.tar.gz

  1. Compare the resume2 directory here with the one you created originally using the diff command. Are they identical?
  2. In tdir, run this command:

touch resume2/dirc/dird/d.txt

  1. Compare the resume2 directories again, what is the result? Are they identical? Why or why not?
  2. Change your working directory to your home directory (resume2 should still be there) and remove the resume2 directory (rm -fr resume2) and temp directory (rm -fr tdir), be careful with the rm -fr command, it is very destructive. You want to remove all traces of the resume so far (hint you may want to just move the directories out of the way in case something goes horribly wrong).
  3. Write a bash script called resume2 that does the above steps 1-4 and run it.
  4. Compare the resulting tmp directory with the resulting resume2 directory. Are they identical?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Oracle Solaris 11.2 System Administration (oracle Press)

Authors: Harry Foxwell

1st Edition

007184421X, 9780071844215

More Books

Students also viewed these Databases questions