LAB7 Linux
LAB7 Linux
7.2.1
cd
mkdir mybackups
tar –cvf mybackups/udev.tar /etc/udev
ls mybackups
The tar(Tape Archive) command is used to create an archive file of the /etc/udev directory, it is also
used to merge multiple files into a single file. By default it does not compress the data.The –c option
tells the tar command to create a tar file. The –v option stands for verbose which instructs the tar
command to demonstrate what it is doing.The –f option is used to specify the name of the tar file
’
7.2.2
tar –tvf mybackups/udev.tar – displays the content of a tar file, t = list of contents v = verbose, f
=filename
7.2.3
cd mybackups
tar –xvf udev.tar..gz
ls – list contents in a directory
ls etc – list contents in etc directory
ls etc/udev – list contents in udev directory
ls etc/udev/rules.d –this command with arguments extracts the content of an archive
7.2.5
cp /usr/share/dict/words
gzip words - this command use to compress words
ls –l words.gz - gzip and gunzip is used to compress and uncompress a file. It is used here to compress
a copy of the words file
7.2.7
ls -1 words.gz
gunzip words.gz
ls -1 words - uncompresses the words.gz file
7.2.8
ls –l words
bzip2 words
ls –l words.bz2 - same with gzip and gunzip, bzip2 and bunzip2 compresses and uncompresses a file.
It is used here to compress a copy of the words file
7.2.9
ls -1 words.bz2
bunzip 2 words.bz2
ls -1 words - uncompresses the words.bz2 file
7.2.10
7.2.11
7.2.13
unzip udev.zip – this command main function is to extract the zip archive