Learn the syntax of the tar command using the man command Use tar \"to stuff\" t
ID: 3862556 • Letter: L
Question
Learn the syntax of the tar command using the man command
Use tar"to stuff" three files and then "unstuff" them into a new directory. Include the -v option.
Turn in the following commands (with no errors) and any output from the commands.
1) ll to show the original 3 files
2) run the tar command to stuff three files
3) ll to show the 'tar archive'
4) mkdir newdir to create a new directory to unstuff the 'tar archive'
5) mv the 'tar archive' to the new directory newdir
6) from newdir, run the tar command to unstuff the three files into the newdir directory
7) ll the new directory newdir to show the extracted files
Explanation / Answer
1.
[testdir]$ ll
total 0
-rw-r--r-- 1 test test 0 Mar 16 06:27 file1
-rw-r--r-- 1 test test 0 Mar 16 06:27 file2
-rw-r--r-- 1 test test 0 Mar 16 06:27 file3
2.
[testdir]$ tar -cvf archive.tar file1 file2 file3
file1
file2
file3
3.
[testdir]$ ll
total 12
-rw-r--r-- 1 test test 10240 Mar 16 06:33 archive.tar
-rw-r--r-- 1 test test 0 Mar 16 06:27 file1
-rw-r--r-- 1 test test 0 Mar 16 06:27 file2
-rw-r--r-- 1 test test 0 Mar 16 06:27 file3
4.
[testdir]$ mkdir newdir
5.
[testdir]$ mv archive.tar newdir
[testdir]$ ll
total 4
-rw-r--r-- 1 test test 0 Mar 16 06:27 file1
-rw-r--r-- 1 test test 0 Mar 16 06:27 file2
-rw-r--r-- 1 test test 0 Mar 16 06:27 file3
drwxr-xr-x 2 test test 4096 Mar 16 06:35 newdir
[testdir]$ cd newdir/
[newdir]$ ll
total 12
-rw-r--r-- 1 test test 10240 Mar 16 06:33 archive.tar
6.
[newdir]$ tar -xvf archive.tar
file1
file2
file3
7.
[newdir]$ ll
total 12
-rw-r--r-- 1 test test 10240 Mar 16 06:33 archive.tar
-rw-r--r-- 1 test test 0 Mar 16 06:27 file1
-rw-r--r-- 1 test test 0 Mar 16 06:27 file2
-rw-r--r-- 1 test test 0 Mar 16 06:27 file3
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.