Time: 10 minutes
Objective: Create, view and extract tar archives.
Description: In this activity, the student will use the tar utility to create, view, and extract a tar archive and use it options to name the tar file and view files as they are being archived and extracted.
1. Start your Linux server virtual machine and sign-on with your individual user ID. All Activities should begin in your home directory.
2. Create a directory by typing mkdir Act6-1 and press Enter. Switch to this new directory by typing cd Act6-1 and pressing Enter. Then create three empty files by typing touch apple banana orange and press Enter.
3. Type tar -cvf fruit.tar apple banana orange and press Enter to create a tar file named fruit.tar. (Note: Make sure you include a space after fruit.tar).
In addition, the file extension .tar is not necessary, but it helps you identify the archive file when viewing a directory’s contents.
4. View the contents of your current directory. What is the size of your .tar file? ________________________________________________
2.33 points
QUESTION 2
5. Simulate a user accidently deleting the three files by typing rm apple banana orange and press Enter.
View your current working directory again, are the files gone?
________________________________2.33 points
QUESTION 3
6. To list the archive file’s contents, type tar -tvf fruit.tar and press Enter. What do you see?
____________________________________________________________________2.33 points
QUESTION 4
7. Now, extract the archive file’s contents by typing tar -xvf fruit.tar and press Enter. View your current directory once more.
Are your three files back? Is the archive file still there?
___________________________________________________________2.33 points
QUESTION 5
8. Remove the tar file by typing rm fruit.tar and press Enter. Leave your virtual machine running for the next exercise.
All commands were executed on Linux Ubuntu. Please comment if you have any doubts.
Please UPVOTE
1. Start your Linux server virtual machine and sign-on with your individual user ID. All Activities should begin in your home directory.
2. Create a directory by typing mkdir Act6-1 and press Enter. Switch to this new directory by typing cd Act6-1 and pressing Enter. Then create three empty files by typing touch apple banana orange and press Enter.
3. Type tar -cvf fruit.tar apple banana orange and press Enter to create a tar file named fruit.tar. (Note: Make sure you include a spaceafter fruit.tar).
In addition, the file extension .tar is not necessary, but it helps you identify the archive file when viewing a directory’s contents.
4. View the contents of your current directory. What is the size of your .tar file?
Size is 1024 Kb
2.33 points
QUESTION 2
5. Simulate a user accidently deleting the three files by typing rm apple banana orange and press Enter.
View your current working directory again, are the files gone?
Yes, file are gone2.33 points
QUESTION 3
6. To list the archive file’s contents, type tar -tvf fruit.tar and press Enter. What do you see?
We see the contents of the tar file2.33 points
QUESTION 4
7. Now, extract the archive file’s contents by typing tar -xvf fruit.tarand press Enter. View your current directory once more.
Are your three files back? Is the archive file still there?
Yes, the file are back now since we extracted them back from the tar file.2.33 points
QUESTION 5
8. Remove the tar file by typing rm fruit.tar and press Enter. Leave your virtual machine running for the next exercise.
If you have any doubts, leave a comment below before rating.
I'll be happy to assist you further.
PLEASE GIVE IT A THUMBS UP, I SERIOUSLY NEED ONE,
IF YOU NEED ANY MODIFICATION THEN LET ME KNOW, I WILL DO IT FOR YOU
Get Answers For Free
Most questions answered within 1 hours.