Quiz Space

Intro to Linux End Term: 13 April 2025, Set QEF1 (January 2025 term)

Question 1

+7 marksOne correct option

What will be the output of the command

bash
sort -n file1.txt file2.txt | awk '!seen[$1]++ {print $1, $2, $3}'

given the following content of file1.txt and file2.txt?

file1.txtfile2.txt
101 John Doe102 Michael Johnson
103 Jane Smith103 Jane Smith
105 Emma Brown106 Lily Evans
107 William Harris107 William Harris
109 Oliver Lewis110 Sophia Turner
  1. A
  2. B
  3. C
  4. D

Question 2

+7 marksOne correct option

Schedule the script /home/user/backup.sh to meet the following requirements
1. The job should run at the 2nd minute of every hour, but only during weekdays (Monday to Friday).
2. Additionally, the job must not run during the first and last days of each month.
3. It should execute a script located at /home/user/backup.sh and log the output to
/var/log/backup.log (append mode).
Which of the following exact crontab entry is used to schedule this job.

  1. A
  2. B
  3. C
  4. D

Question 3

+7 marksOne correct option
awk
#!/usr/bin/awk -f
{
for (i = 1; i <= NF; i++) {
word = tolower($i)
gsub(/[^a-z]/, "", word)
if (word != "")
freq[word]++
}
}
END {
for (word in freq) {
printf "%-15s %d\n", word, freq[word]
}
}

What is the primary purpose of this AWK script?

  1. A

    To convert contents of file to lowercase.

  2. B

    To count the frequency of each word in a text file.

  3. C

    To count the number of lines in a file.

  4. D

    To replace all non-alphabetic characters in a file.

Also asked in End Term 13 Apr 2025

13 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 Intro to Linux End Term 13 Apr 2025 Set QEF1 paper

The IIT Madras BS Introduction to Linux and Programming (Intro to Linux) End Term paper sat on 13 Apr 2025, in the January 2025 term, set QEF1: 16 questions for 100 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.

FeatureIntro to Linux End Term 13 Apr 2025 Set QEF1 at a glance
TermJanuary 2025 term
SubjectIntroduction to Linux and Programming
Course codeCS1102
Questions16
Marks100
Duration180 min
MCQ13
MSQ1
Numerical2
Official paperIIT M ES FOUNDATION AN EXAM QEF3 13 Apr 2025
Negative markingNo negative marking.
Updated

Other sets that day

Same End Term, other subjects

More Intro to Linux