Answered step by step
Verified Expert Solution
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:
- 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 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
- 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
- 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
- Compare the resume2 directory here with the one you created originally using the diff command. Are they identical?
- In tdir, run this command:
touch resume2/dirc/dird/d.txt
- Compare the resume2 directories again, what is the result? Are they identical? Why or why not?
- 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).
- Write a bash script called resume2 that does the above steps 1-4 and run it.
- 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
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started