Quiz Space

System Commands OPPE 2: September 2023, Set 2 (September 2023 term)

Question 1

+15 marksProgramming

Write a sed script script.sed which will remove all lines which have any one of the words "install", "installed" or "status". Use the following text as reference.

Sample input

2022-05-05 15:55:18 purge grub-pc:amd64 2.02-2ubuntu8.23 <none>
2022-05-05 15:55:18 purge grub-legacy-ec2:all 1:1 <none>
2022-05-05 15:55:18 purge grub-common:amd64 2.02-2ubuntu8.23 <none>
2022-05-05 15:55:14 status installed linux-virtual:amd64 4.15.0.176.165
2022-05-05 15:55:14 status half-installed linux-virtual:amd64 4.15.0.176.165
2022-05-05 15:55:14 status not-installed linux-virtual:amd64 <none>
2022-05-05 15:55:17 status installed grub-legacy-ec2:all 1:1
2022-05-05 15:55:17 status half-installed grub-legacy-ec2:all 1:1
2022-05-05 15:55:17 status installed os-prober:amd64 1.74ubuntu1
2022-05-05 15:55:17 status half-installed os-prober:amd64 1.74ubuntu1
2022-05-05 15:55:17 status installed grub2-common:amd64 2.02-2ubuntu8.23
2022-05-05 16:13:44 status half-installed libogg0:amd64 1.3.2-1
2022-05-05 16:13:44 install x11-common:all <none> 1:7.7+19ubuntu7.1
2022-05-05 16:13:44 status half-installed x11-common:all 1:7.7+19ubuntu7.1
2022-05-05 16:13:44 install libice6:amd64 <none> 2:1.0.9-2
2022-05-05 16:13:44 status half-installed libice6:amd64 2:1.0.9-2
2022-05-05 16:13:44 install libsm6:amd64 <none> 2:1.2.2-1
2022-05-05 16:13:44 status half-installed libsm6:amd64 2:1.2.2-1
2022-05-05 16:13:44 install fonts-dejavu-core:all <none> 2.37-1
2022-05-05 16:13:44 status half-installed fonts-dejavu-core:all 2.37-1
2022-05-05 16:13:44 install fontconfig-config:all <none> 2.12.6-0ubuntu2
2022-05-05 16:13:44 status half-installed fontconfig-config:all 2.12.6-0ubuntu2
2022-05-05 16:13:44 install libfontconfig1:amd64 <none> 2.12.6-0ubuntu2
2022-05-05 16:13:44 status half-installed libfontconfig1:amd64 2.12.6-0ubuntu2
2022-05-05 16:13:44 install libxrender1:amd64 <none> 1:0.9.10-1

Sample output

2022-05-05 15:55:18 purge grub-pc:amd64 2.02-2ubuntu8.23 <none>
2022-05-05 15:55:18 purge grub-legacy-ec2:all 1:1 <none>
2022-05-05 15:55:18 purge grub-common:amd64 2.02-2ubuntu8.23 <none>

Question 2

+15 marksProgramming

Write a sed script script.sed which will remove all html tags. Use the following text as reference to build your sed script. Assume that every tag is closed by a >, which may come on a later line than the one where the tag opens. The output is a single line: every line break of the input becomes one space.

Sample Input

A <b>table</b> is an arrangement of
<a href="/wiki/Information" title="Information">information</a> or
<a href="/wiki/Data" title="Data">data</a>, typically in rows and columns, or
possibly in a more complex structure. Tables are widely used in
<a href="/wiki/Communication" title="Communication">communication</a>,
<a href="/wiki/Research" title="Research">research</a>, and
<a href="/wiki/Data_analysis" title="Data analysis">data analysis</a>. Tables
appear in print media, handwritten notes, computer software, architectural
ornamentation, traffic signs, and many other places. The precise conventions and
terminology for describing tables vary depending on the context. Further, tables
differ significantly in variety, structure, flexibility, notation,
representation and use.<sup id="cite_ref-Fink000_1-0" class="reference"
  ><a href="#cite_note-Fink000-1">[1]</a></sup
><sup id="cite_ref-Mcnabb000_2-0" class="reference"
  ><a href="#cite_note-Mcnabb000-2">[2]</a></sup
><sup id="cite_ref-Morgan000_3-0" class="reference"
  ><a href="#cite_note-Morgan000-3">[3]</a></sup
><sup id="cite_ref-Robey000_4-0" class="reference"
  ><a href="#cite_note-Robey000-4">[4]</a></sup
><sup id="cite_ref-Zielinski000_5-0" class="reference"
  ><a href="#cite_note-Zielinski000-5">[5]</a></sup
>
Information or data conveyed in table form is said to be in
<b>tabular</b> format (<a
  href="https://en.wiktionary.org/wiki/tabular#Adjective"
  class="extiw"
  title="wikt:tabular"
  >adjective</a
>). In books and technical articles, tables are typically presented apart from
the main text in numbered and captioned
<a href="/wiki/Floating_block" class="mw-redirect" title="Floating block"
  >floating blocks</a
>.

Sample Output

A table is an arrangement of information or data, typically in rows and columns, or possibly in a more complex structure. Tables are widely used in communication, research, and data analysis. Tables appear in print media, handwritten notes, computer software, architectural ornamentation, traffic signs, and many other places. The precise conventions and terminology for describing tables vary depending on the context. Further, tables differ significantly in variety, structure, flexibility, notation, representation and use.[1][2][3][4][5] Information or data conveyed in table form is said to be in tabular format (adjective). In books and technical articles, tables are typically presented apart from the main text in numbered and captioned floating blocks.

Question 3

+15 marksProgramming

A dpkg log contains the information regarding installed, removed and purged packages. Using the following log for your reference write an AWK script script.awk which will list INSTALLED packages, REMOVED packages and PURGED packages with the total installations, removals purges as shown in the standard output.

Note: Use Column 3 to decide the installed/removed package

Sample Input

2022-05-05 15:55:14 startup packages remove
2022-05-05 15:55:14 remove linux-virtual:amd64 4.15.0.176.165 <none>
2022-05-05 15:55:14 remove linux-headers-virtual:amd64 4.15.0.176.165 <none>
2022-05-05 15:55:14 remove linux-headers-generic:amd64 4.15.0.176.165 <none>
2022-05-05 15:55:15 remove linux-modules-4.15.0-176-generic:amd64 4.15.0-176.185 <none>
2022-05-05 15:55:17 startup packages remove
2022-05-05 15:55:17 remove grub-legacy-ec2:all 1:1 <none>
2022-05-05 15:55:17 remove os-prober:amd64 1.74ubuntu1 <none>
2023-12-09 11:57:17 startup packages remove
2023-12-09 11:57:18 remove npm:all 3.5.2-0ubuntu4 <none>
2023-12-09 11:57:18 remove node-gyp:all 3.6.2-1ubuntu1 <none>
2022-05-05 15:55:15 purge linux-image-4.15.0-176-generic:amd64 4.15.0-176.185 <none>
2022-05-05 15:55:15 purge linux-modules-4.15.0-176-generic:amd64 4.15.0-176.185 <none>
2022-05-05 15:55:18 startup packages purge
2022-05-05 15:55:18 purge grub-pc:amd64 2.02-2ubuntu8.23 <none>
2022-05-05 15:55:18 purge grub-legacy-ec2:all 1:1 <none>
2022-05-05 15:55:18 purge grub-common:amd64 2.02-2ubuntu8.23 <none>
2022-05-05 15:55:14 status installed linux-virtual:amd64 4.15.0.176.165
2022-05-05 15:55:14 status half-installed linux-virtual:amd64 4.15.0.176.165
2022-05-05 15:55:14 status not-installed linux-virtual:amd64 <none>
2022-05-05 15:55:17 status installed grub-legacy-ec2:all 1:1
2022-05-05 15:55:17 status half-installed grub-legacy-ec2:all 1:1
2022-05-05 15:55:17 status installed os-prober:amd64 1.74ubuntu1
2022-05-05 15:55:17 status half-installed os-prober:amd64 1.74ubuntu1
2022-05-05 15:55:17 status installed grub2-common:amd64 2.02-2ubuntu8.23
2022-05-05 16:13:44 status half-installed libogg0:amd64 1.3.2-1
2022-05-05 16:13:44 install x11-common:all <none> 1:7.7+19ubuntu7.1
2022-05-05 16:13:44 status half-installed x11-common:all 1:7.7+19ubuntu7.1
2022-05-05 16:13:44 install libice6:amd64 <none> 2:1.0.9-2
2022-05-05 16:13:44 status half-installed libice6:amd64 2:1.0.9-2
2022-05-05 16:13:44 install libsm6:amd64 <none> 2:1.2.2-1
2022-05-05 16:13:44 status half-installed libsm6:amd64 2:1.2.2-1
2022-05-05 16:13:44 install fonts-dejavu-core:all <none> 2.37-1
2022-05-05 16:13:44 status half-installed fonts-dejavu-core:all 2.37-1
2022-05-05 16:13:44 install fontconfig-config:all <none> 2.12.6-0ubuntu2
2022-05-05 16:13:44 status half-installed fontconfig-config:all 2.12.6-0ubuntu2
2022-05-05 16:13:44 install libfontconfig1:amd64 <none> 2.12.6-0ubuntu2
2022-05-05 16:13:44 status half-installed libfontconfig1:amd64 2.12.6-0ubuntu2
2022-05-05 16:13:44 install libxrender1:amd64 <none> 1:0.9.10-1

Sample output

linux-virtual:amd64 <none> REMOVED
linux-headers-virtual:amd64 <none> REMOVED
linux-headers-generic:amd64 <none> REMOVED
linux-modules-4.15.0-176-generic:amd64 <none> REMOVED
grub-legacy-ec2:all <none> REMOVED
os-prober:amd64 <none> REMOVED
npm:all <none> REMOVED
node-gyp:all <none> REMOVED
x11-common:all 1:7.7+19ubuntu7.1 INSTALLED
libice6:amd64 2:1.0.9-2 INSTALLED
libsm6:amd64 2:1.2.2-1 INSTALLED
fonts-dejavu-core:all 2.37-1 INSTALLED
fontconfig-config:all 2.12.6-0ubuntu2 INSTALLED
libfontconfig1:amd64 2.12.6-0ubuntu2 INSTALLED
libxrender1:amd64 1:0.9.10-1 INSTALLED
total installed=7; total removed=8

3 more questions in this paper

Sign in with Google — it is free — to see every question with its answer and explanation, practise it in learning mode, or take it as a timed mock test.

More on the System Commands OPPE 2 Sept 2023 Set 2 paper

The IIT Madras BS System Commands (System Commands) OPPE 2 paper sat on Sept 2023, in the September 2023 term, set 2: 6 questions for 90 marks in 180 minutes. The first 3 questions are below. Sign in with Google — it is free — to see the whole paper with its answers and explanations, in learning mode or as a timed mock test.

FeatureSystem Commands OPPE 2 Sept 2023 Set 2 at a glance
TermSeptember 2023 term
SubjectSystem Commands
Course codeBSSE2001
Questions6
Marks90
Duration180 min
Programming6
Official paperOPPE 2, Sep 2023 Set 2
Negative markingNo negative marking.
Updated

Other sets that day

More System Commands