Font size
WorksheetsOS quiz
Total questions: 25
Worksheet time: 19mins
Command to list files in Linux, including hidden ones?
(a)
GCC flag to name the output file?
(a)
Function to read a character from stdin in C?
(a)
How to terminate a while loop on EOF in C?
(a)
Command to delete a directory recursively?
(a)
What does argv[0] contain?
(a)
Write the main signature for command-line args
(a)
Command to count lines in a file?
(a)
How to compile prog.c into prog with warnings?
(a)
What does chmod 755 file do?
(a)
Why does ./a.out fail with "Permission denied"?
(a)
Fix: printf("Bonjour") prints nothing?
(a)
Why might gcc file.c fail silently?
(a)
Command to debug a segfault?
(a)
What does & do in ./prog &?
(a)
How to detect -h flag in argv?
Loop +
(a)
Write a line to open file.txt for reading in C
(the vareabele must be a pointure named f)
(a)
How to check if fopen failed?
file is f
(a)
What is stderr?
Error of :
(a)
How to redirect stderr to a file?
(the file named file.txt)
(a)
Command to find all .c files modified today?
(a)
Write a macro to swap two integers:
(varabeles are a,b,t)
(a)
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) >
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)
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)
