03122014 Flashcards

0
Q

COMPRESSING FILES USING ZIP

A

TAR

file packaging and compression

cd /tmp
mkdir lbooktemp
cd lbooktemp/
ls > f1.txt; route > f2.txt; dmesg > f3.txt
ifconfig > ifconfig.dat; dmesg > dmesg.dat
zip lbook1.zip f1.txt f2.txt f3.txt
zip lbook1.zip *.txt *.dat
mkdir test
cp lbook1.zip test
cd test
unzip lbook1.zip
ls -la
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

USING GREP TO FIND PATTERNS

Go to /tmp
Then output dmesg to a text file
Find pattern for “network”

A

cd /tmp
dmesg > dmesg1.txt
grep network dmesg1.txt
grep network dmesg1.txt

-i, –ignore-case ignore case distinctions

grep -i cdrom dmesg1.txt
echo $?

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Syntax for ZIP is ___

A

“zip zipped-files files-to-zip”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

You can also view the contents of a ZIP file without extracting anything,by running the following command:

A

unzip -l zipped-file

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

COMPRESSING FILES USING TAR

A
cd /tmp/lbooktemp
tar cvzf lbook1.tar.gz *.txt
file lbook1.tar.gz
cp lbook1.tar.gz test
cd test
tar xvsf lbook1.tar.gz
ls -la
tar tvsf lbook1.tar.gz
cd /tmp
tar cvzf lbooktemp1.tar.gz lbooktempcd
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Suppose you have sent that file to someone that is running Linux System, and want to ensure it did not get corrupted along the way.

A

cd /tmp
dmesg > file1.txt
stat file1.txt
sum file1.txt

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

The first number is the ____ and the second is the _____ for that file. If the other person runs a sum on his copy of the file and sees the same info, the files are the same

A

checksum, number of blocks

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Print or control the kernel ring buffer

A

dmesg

How well did you know this?
1
Not at all
2
3
4
5
Perfectly