wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

OS quiz

Total questions: 25

Worksheet time: 19mins

Name
Class
Date
1.

Command to list files in Linux, including hidden ones?

(a)  

2.

GCC flag to name the output file?

(a)  

3.

Function to read a character from stdin in C?

(a)  

4.

How to terminate a while loop on EOF in C?

(a)  

5.

Command to delete a directory recursively?

(a)  

6.

What does argv[0] contain?

(a)  

7.

Write the main signature for command-line args

(a)  

8.

Command to count lines in a file?

(a)  

9.

How to compile prog.c into prog with warnings?

(a)  

10.

What does chmod 755 file do?

(a)  

11.

Why does ./a.out fail with "Permission denied"?

(a)  

12.

Fix: printf("Bonjour") prints nothing?

(a)  

13.

Why might gcc file.c fail silently?

(a)  

14.

Command to debug a segfault?

(a)  

15.

What does & do in ./prog &?

(a)  

16.

How to detect -h flag in argv?
Loop +

(a)  

17.

Write a line to open file.txt for reading in C

(the vareabele must be a pointure named f)

(a)  

18.

How to check if fopen failed?

file is f

(a)  

19.

What is stderr?

Error of :

(a)  

20.

How to redirect stderr to a file?

(the file named file.txt)

(a)  

21.

Command to find all .c files modified today?

(a)  

22.

Write a macro to swap two integers:

(varabeles are a,b,t)

(a)  

23.

When using gcc -E bonjour.c, the output includes hundreds of lines of preprocessed code. What specific preprocessor directive (e.g., #include, #define) in bonjour.c causes the majority of this expansion?

#include< (a)   >

24.

If you execute a compiled C program (./eko) via symlink (ln -s eko fake), then run ./fake -M, what will argv[0] contain? How could a program detect it was run via symlink?

argv[0] =

(a)  

25.

The PDF of TP mentions /sbin contains "programs système importants." Name one binary in /sbin that directly interacts with the Linux kernel (not userspace), and explain its role.

(a)