1 Create a new file as gziptxt 2 Add some text make it up Q1
1. Create a new file as gzip.txt
2. Add some text (make it up)
Q1: what command would you use to check the file’s size?
3. Compress the file using gzip
Q2: what command would you use to compress the file using the same filename (not extension!).
4. Check the compression level of the compressed object.
Q3: what command would you use to check the compression level?
5. Create a new file as tarball.txt
6. Add some text (different amount than #2) and check the size
7. Tar the tarball.txt file
Q4: what command would you use to tar the file?
Q5: what is the size of the resulting tarball compared to the original?
Solution
>>cat gzip.txt <enter>--will create file and enter some text and press Ctrl+D to save.
2.To add more tecxt
vi gzip.txt --terminal opens enter text using I -insert mode the at end prrss ESC to return to command mode .to close vi ans save ur file type \":wq\"
size:
ls -l gzip.txt or ls -l gzip.txt | awk \'{print $5}\' --will return the size
stat gzip.txt
3.gzip gzip.txt --gzips
4 We cannot find levels directly
5.cat >>tarball.txt <enter >
enter txt in file Ctrl+D saves ur file
6 vi tarball.txt
--insert modeby pressing i on keyboard
additionl tct EsC :wq!
ls -l tarball.txt | awk \'{print $5}\'
7.tar -cvzf tarball.tar.gz /path [metion the path ]
| awk \'{print $5}\'
Here c-create tar file
V-verbosely show .tar file progress
F-filename type of archivevfile.
