Indian Institute of Technology Madras
BS Degree Programme · Examination & Study Paper
System Commands
End Term · 13 Apr 2025 (Forenoon)
Examination Instructions & Guidelines
- Solve on notebook/paper first before checking solutions.
- MCQ: Exactly 1 option is correct. Negative marking applies.
- MSQ: One or more options correct. Select all to score.
- NAT: Numerical response. No negative marking.
- Scientific calculator allowed for all calculations.
- Official answer key is sealed at the end of this sheet.
- Q1MCQ7 Marks·Choose one option

- A

- B

- C

- D

- A
- Q2MCQ7 Marks·Choose one 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.
- A

- B

- C

- D

- A
- Q3MCQ7 Marks·Choose one option
What is the primary purpose of this AWK script?- ATo convert contents of file to lowercase.
- BTo count the frequency of each word in a text file.
- CTo count the number of lines in a file.
- DTo replace all non-alphabetic characters in a file.
- Q4MCQ7 Marks·Choose one option

- ADeletes all .log files in /home.
- BLists all .log files in /sample/logs.
- CFinds all .log files and backs them up.
- DRenames .log files to .bak in /home.
- Q5MCQ6 Marks·Choose one option
Select a single sed command to achieve the following. a) Find all lines that start with the word "error". b) Replace the word "error" with "warning" only on those lines. c) Append " - needs review" to the end of those same lines.
- A

- B

- C

- D

- A
- Q6MCQ6 Marks·Choose one option
Consider current_permissions contain the present permissions of a file. Which of the following shell script statement calculate the new permissions by removing the read permission?
- A

- B

- C

- D

- A
- Q7MCQ6 Marks·Choose one option
Select a command to find all established suspicious TCP connections on port 80 using netstat
- A

- B

- C

- D

- A
- Q8MCQ6 Marks·Choose one option
Which of the following vi command is used to replace the word 'apple' with 'orange' only in lines 10 to 20 of a file, and appear at the beginning or end of the line, without case sensitive and without user interaction.
- A

- B

- C

- D

- A
- Q9MCQ6 Marks·Choose one option

- A

- B

- C

- D

- A
- Q10MCQ6 Marks·Choose one option

- ADisplay the today’s date
- BNothing is printed
- Clist all the lines of file1 that do not match file2
- D0
- Q11MCQ6 Marks·Choose one option

- ADeletes the first two fields in the CSV file.
- BSwaps the first and second fields of the CSV file.
- CAdds a new field to the CSV file.
- DReplaces all commas in the CSV file with spaces.
- Q12MCQ6 Marks·Choose one option

- ACompresses the /remove directory into a tarball, excluding the /sample subdirectory, and names it backup.tar.gz.
- BDeletes the /sample subdirectory before creating a compressed tarball of /remove.
- CExtracts the contents of backup.tar.gz to /remove, excluding the /sample directory.
- DLists the contents of /remove, ignoring the /sample subdirectory.
- Q13MCQ6 Marks·Choose one option
You are working in a team with multiple developers using Git. One of your colleagues has created a feature branch from main, but over time, the main branch has received several commits. Your colleague is now attempting to merge the feature branch into main, but a conflict arises in a file that was modified both in the main branch and in the feature branch. How would you resolve the conflict, ensuring that the feature branch is up-to-date with the latest changes from main and that no work is lost? Additionally, how would you ensure that this situation is prevented in the future?
- Aa. Merge the feature branch into main without updating main. Resolve conflicts directly in the merge commit. b. Regularly merge main into the feature branch to avoid future conflicts.
- Ba. Switch to the feature branch and run git pull origin feature-branch. b. Resolve the conflict directly in main, then push the changes.
- Ca. Ensure main is up-to-date by pulling the latest changes. b. Switch to the feature branch and merge main into it. c. Resolve the conflicts, commit the changes, and push the feature branch. d. Merge the feature branch into main via a pull request. e. Prevent future conflicts by encouraging regular updates between branches.
- Da. Merge the feature branch into main without resolving conflicts. b. Use git reset to undo any conflicts and continue with the merge.
- Q14MSQ6 Marks·Choose all correct options

- A

- B

- C

- D

- E

- A
- Q15NAT6 Marks·Write the number
Your answer: - Q16NAT6 Marks·Write the number
Your answer: