0% found this document useful (0 votes)
55 views

Week 8 - Graded + Practice Assignment

Iitm..
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Week 8 - Graded + Practice Assignment

Iitm..
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 12

WEEK 8 - Graded Assignment

Question 1
Which of the following commands can be used to check the processor information your linux machine is
running on? [MSQ]

(a) hwinfo
(b) lshw
(c) lspci
(d) cat proc/cpuinfo
(e) cat proc/partitions

Answer
(a), (b) and (d)

Question 2
Which of the following commands can be used to print the total amount of memory(in gigabytes) available
on your linux machine? The output may or may not contain any string for unit(i.e. GB), but should print only
one number in gigabytes that is the total memory available. [MSQ]

(a) hwinfo | grep "memory" | head -1 | cut -d ":" -f 2


(b) free --gibi | awk 'BEGIN{FS=" "} FNR==2{print $2}'
(c) free --gibi | head -1 | cut -d ":" -f 2
(d) sudo dmidecode --type memory | grep "Maximum Capacity" | cut -d ":" -f 2

Answer
(b) and (d)

Question 3
Which command will change the prompt string to show date, command number and current username
followed by character "@" followed by complete hostname and finally followed by the string ":$", in
the same sequence?

For example if the current username is "SC", complete hostname is "SC-HP-Probook", date today is "Tue
Mar 08" and command number is "48" the prompt string should look like

Tue Mar 08 48 SC@SC-HP-Probook :$

(a) PS1="\d # \u \H :$"

(b) PS1="\d \# \u \H :$"

(c) PS1="\d \# \u@\H :$"


(d) PS1="\d \# \u@\H :\$"

Answer
(d)

Question 4
How many times per day the below process is executed? [NAT]

0 20 * * 1-5 zip -r ~/backup/project_246_$(date -u +"%Y-%m-%dT%H:%M:%SZ").zip


~/project_246/

Answer
1
Question 5
Select all the days the below process is executed? [NAT]

0 20 * * 1-5 zip -r ~/backup/project_246_$(date -u "+%Y-%m-%dT%H:%M:%SZ").zip


~/project_246/

(a) Sunday
(b) Monday
(c) Tuesday
(d) Wednesday
(e) Thursday
(f) Friday
(g) Saturday

Answer
(b), (c), (d), (e), (f)
Question 6
Suppose you have to send a good morning message to everyone at 6 am in the morning everyday. Assume
the command send-good-morning will send the message to everyone. Select the job will do that.

(a) * */6 * * * send-good-morning


(b) 0 * * * * send-good-morning
(c) 6 0 * * * send-good-morning
(d) * * * 6 0 send-good-morning
(e) 0 6 * * * send-good-morning

Answer
(e)

Question 7
Every device connected to the Internet has at least one IP address which indicates where traffic has come
from. Each IP address has some associated port numbers for each transport protocol used for determining
the correct receiving application. IP addresss and Port numbers are respectively

(1) 32-bit nonnegative integer and 16-bit nonnegative integers

(2) 32-bit nonnegative natural numbers and 16-bit nonnegative natural numbers

(3) 16-bit nonnegative integer and 32-bit nonnegative integers

(4) 16-bit nonnegative natural numbers and 32-bit nonnegative natural numbers

Answer
(1) 32-bit nonnegative integer and 16-bit nonnegative integers

Question 8
Which command will give information on open network ports on the machine?

(a) nslookup
(b) whois
(c) wireshark
(d) netstat
Answer
(d)

Question 9
"test.tar" contains three files test1, test2 and test3. Choose the right command that will extract these files
from "test.tar". (MCQ)

(1)

$ tar -cvf test.tar test1 test2 test3

(2)

$ tar -xvf test1 test2 test3

(3)

$ tar -xvf test.tar

(4)

$ tar -cvf test.tar

Answer
3.

Question 10
$ nslookup google.com

The above command is used to (MCQ)

(1) Retrieve information about a domain name such as its server and ip address.

(2) looks up number of pings to the domain name "google.com".

(3) Gets the DNS of the domain on google.com

(4) none of the above


Answer
(1)

Question 11
Match the following networing commands to its respective function.
(MCQ)

Option Function

1. ifconfig a. It is a network troubleshooting utility

2. ping b. Used to Query DNS related information

3. dig c. Display and manipulate route and network interfaces

4. traceroute d. Checks connectivity between two nodes

5. wget e. Downloads a file from internet

(1) 1—>c; 2—>d; 3—>b; 4—>a; 5->e;

(2) 1—>b; 2—>e; 3—>d; 4—>c; 5->a;

(3) 1—>e; 2—>d; 3—>c; 4—>a; 5->b;

(4) 1—>a; 2—>c; 3—>e; 4—>d; 5->b;

Answer
(1) 1—>c; 2—>d; 3—>b; 4—>a; 5->e;

Question 12
Match the following options of "tar" command to their use.

Option Usage

1. x i. use gzip

2. v ii. name of the archive file

3. f iii. extract files from an archive

4. z iv. verbosely list files that are processed

(a) 1-a, 2-c, 3-d, 4-b


(b) 1-c, 2-d, 3-a, 4-b

(c) 1-d, 2-c, 3-a, 4-b

(d) 1-c, 2-d, 3-b, 4-a

Answer
(d)

Question 13
Contents of file1

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
cccccccccccccccccccccccccccccccccccc
dddddddddddddddddddddddddddddddddddd
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
ffffffffffffffffffffffffffffffffffff

Contents of file2

Wj^rofdOhZO[giJYBHMDYVoqCGfREi[MTmF`
FHWf]eaUIqJXCkLnYTmfOCVnc\ZMDdlrcp[D
`EelM]krNNB^MIJmDniBW]JlWV`k^YmGBbAV
PICXGELJh[Xmmid_fen`E\Xf]Y]kCoRkXEKD
bDfRfJmolQbTVJDVbWSfoTqODfYkaNjHKf]_
[SmrlE\\l]ZTYQeHjKJkFETO]LDhHVValIqD

Note that both file1 and file2 have same size and number of characters. Both the files are compressed using
the utility gzip to file1.gz and file2.gz respectively.

Choose the correct statement.

(a) The size of file1.gz will be greater than file2.gz

(b) The size of file1.gz will be lesser than file2.gz

(c) The size of file1.gz will be the same as the size of file2.gz

(d) The size of file1.gz will always greater than file2.gz because file1 have simple patterns.

Answer
(b)

Question 14
Below are the contents of the file "abcdef", where each line has 36 characters.

aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb
cccccccccccccccccccccccccccccccccccc
dddddddddddddddddddddddddddddddddddd
eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee
ffffffffffffffffffffffffffffffffffff

What will be the size of the file in bytes when it is compressed using bzip2? [NAT]

Answer
Range: From 50 to 60

Question 15
Choose the command to list all the empty files and delete them. [MSQ]

(a) find . -type f -delete

(b) find . -type f -empty -delete

(c) find . -type f -empty -exec rm {} \;

(d) find . -type f -empty | xargs rm

Answer
(b), (c), (d)

Question 16
Three Hard disk drives of capacity 456 Gb, 564 Gb and 768 Gb are connected in RAID 0. What is the
equivalent storage capacity of the RAID arrangement?

(1) 456 Gb

(2) 768 Gb

(3) 1368 Gb

(4) 2304 Gb
Answer
(3) 1368 Gb

Question 17
A data centre uses old recycled small size disk drives as a cost cutting measure. The downside in using
recycled disk drives is that each drive can handle only one query at a time. Which of the following RAID
configurations should the data centre deploy to achieve better performance(read speeds) and for data and
sustain at least one disk failure without loosing data? [MSQ]

(1) RAID 0

(2) RAID 1

(3) RAID 4

(4) RAID 6

Answer
(3) and (4)

Practice Problems Week 8


Problem 1
Which of the following ports are registered ports?

(1) 0 – 1023

(2) 1024 – 49151

(3) 49152 – 65535

(4) 0 - 65535

Answer
(2) 1024 – 49151

Problem 2
Multiple correct answers are possible for this question.
The command used to find your IP address in Ubuntu is;
(MSQ)
(1) ifconfig -a

(2) ip add

(3) give ip

(4) hostname -I

Answer
1. ifconfig -a
2. ip add
3. hostname -I

Problem 3
dig is a DNS lookup utility. Match the options of the dig command to its respective function.
(MCQ)

Option Function

1. -4 a. Print the version number and exit.

2. -m b. Print query times in microseconds instead of milliseconds

3. -u c. Uses IPv4 only

4. -v d. Enable memory usage debugging.

(1) 1—>c; 2—>d; 3—>b; 4—>a;

(2) 1—>b; 2—>a; 3—>d; 4—>c;

(3) 1—>b; 2—>c; 3—>a; 4—>d;

(4) 1—>a; 2—>c; 3—>b; 4—>d;

Answer
1. 1—>c; 2—>d; 3—>b; 4—>a;

Problem 4
Choose the command which will print all the directories within the current directory, whose names starts
with the letter 'K' and are accessed in last two days.

(a) find /home -type d -mtime +2 -print

(b) find . -type l -mtime +2 -print


(c) find /home -type d -atime +2 -name 'K*' -print

(d) find . -type d -atime -2 -name 'K*' -print

Answer
(d)

Problem 5
Suppose a data centre wishes to configure 3192 * 2 Tb hard disk drives in RAID 6 (1+6) configuration. The
storage capacity of a equivalent disk drive is

(1) 3190 Tb

(2) 6364 Tb

(3) 6380 Tb

(4) 3192 Tb

Answer
(1) 3190 Tb

You might also like