Quiz Space

System Commands OPPE 1: May 2023, Set 2 (May 2023 term)

Question 1

+15 marksProgramming

Write a bash script that adds the total size of only PDF files present in a directory. Assume that the directory only contains files and no subdirectories.

Hint: Use ls -l to get the file size information

Question 2

+15 marksProgramming

A dpkg.log file contains a record of applications installed, removed, upgrade and purge over a period of time. Write a shell script to report the total number of instances when packages are installed, removed, upgraded and purged. A sample of the log file is as follows. Note: Use Installed, update, remove and purge as the keywords for pattern matching.

2022-05-05 15:55:14 startup packages remove
2022-05-05 15:55:14 status installed linux-virtual:amd64 4.15.0.176.165
2022-05-05 15:55:14 remove linux-virtual:amd64 4.15.0.176.165 <none>
2022-05-05 15:55:14 status half-configured 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 config-files linux-virtual:amd64 4.15.0.176.165
2022-05-05 15:55:14 status config-files linux-virtual:amd64 4.15.0.176.165
2022-05-05 15:55:14 status config-files 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:14 status installed linux-headers-virtual:amd64 4.15.0.176.165
2022-05-05 15:55:14 remove linux-headers-virtual:amd64 4.15.0.176.165 <none>
2022-05-05 15:55:14 status half-configured linux-headers-virtual:amd64 4.15.0.176.165
2022-05-05 15:55:14 status half-installed linux-headers-virtual:amd64 4.15.0.176.165
2022-05-05 15:55:15 status config-files linux-image-4.15.0-176-generic:amd64 4.15.0-176.185
2022-05-05 15:55:15 status config-files linux-image-4.15.0-176-generic:amd64 4.15.0-176.185
2022-05-05 15:55:15 status installed linux-modules-4.15.0-176-generic:amd64 4.15.0-176.185
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:15 status half-configured linux-modules-4.15.0-176-generic:amd64 4.15.0-176.185
2022-05-05 15:55:15 status half-installed linux-modules-4.15.0-176-generic:amd64 4.15.0-176.185
2022-05-05 15:55:15 status config-files linux-modules-4.15.0-176-generic:amd64 4.15.0-176.185
2022-05-05 15:55:15 status config-files linux-modules-4.15.0-176-generic:amd64 4.15.0-176.185
2022-05-05 15:55:15 startup packages configure
2022-05-05 15:55:15 startup packages purge
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 status config-files linux-image-4.15.0-176-generic:amd64 4.15.0-176.185
2022-05-05 15:55:15 status config-files linux-image-4.15.0-176-generic:amd64 4.15.0-176.18
2022-05-05 15:55:17 startup packages remove
2022-05-05 15:55:17 status installed grub-pc:amd64 2.02-2ubuntu8.23
2022-05-05 15:55:17 status installed grub-gfxpayload-lists:amd64 0.7
2022-05-05 15:55:17 status installed grub2-common:amd64 2.02-2ubuntu8.23
2022-05-05 15:55:17 status installed grub-pc-bin:amd64 2.02-2ubuntu8.23
2022-05-05 15:55:17 status installed grub-common:amd64 2.02-2ubuntu8.23
2022-05-05 15:55:17 status installed grub-legacy-ec2:all 1:1
2022-05-05 15:55:17 remove grub-legacy-ec2:all 1:1 <none>
2022-05-05 15:55:17 status half-configured grub-legacy-ec2:all 1:1

Question 3

+15 marksProgramming

Create a file structure as shown below; the commands should not output anything.

/potato_recipes/
├── french_fries
│   ├── ingredients.txt
│   └── procedure.txt
├── frites -> french_fries/
└── potato_wedges
    ├── ingredients.txt
    └── procedure.txt
  • potato_recipes is a directory present in the root directory /.

  • french_fries and potato_wedges are the directories present inside the directory potato_recipes.

  • frites is a symbolic link to the directory french_fries

  • ingredients.txt inside the directory potato_wedges is a hard link to the file ingredients.txt inside the directory french_fries

  • procedure.txt are the text file present inside french_fries and potato_wedges

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 1 May 2023 Set 2 paper

The IIT Madras BS System Commands (System Commands) OPPE 1 paper sat on May 2023, in the May 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 1 May 2023 Set 2 at a glance
TermMay 2023 term
SubjectSystem Commands
Course codeBSSE2001
Questions6
Marks90
Duration180 min
Programming6
Official paperOPPE 1, May 2023 Set 2
Negative markingNo negative marking.
Updated

Other sets that day

More System Commands