NUnix · L3 MIAGE · TD
ISTIC · University of Rennes
2026–2027
Use a practice directory for files that you create or change.
Read commands and predict their effects before executing them.
List the entries in /usr/bin whose names:
m.m and have exactly three characters.m and have at least three characters.m and have an extension after a dot.| Directory | Contains |
|---|---|
practice/user1/ |
f1, f2, f3 |
practice/user2/ |
f4 |
The current directory is practice/user2/.
What relative path names user1's file f1?
Using cat and redirections:
f5 containing the line 5 2 3 -1.f6 from f4, followed by f5.user1's f1 to f6.user1's f2 into a new file f7 in user2.Write a script named execution, called with n1 n2 n3.
| Step | Input | Program | Output |
|---|---|---|---|
| 1 | File n1 |
p1 |
File n1.r1 |
| 2 | File n2 |
p1 |
File n2.r1 |
| 3 | n2.r1, then n1.r1 |
p2 |
File n3 |
p1 and p2 read stdin and write stdout.
Concatenate the two intermediate files in the stated order.
Write another version of execution that asks the user for:
Keep the same processing steps and concatenation order.
mysearch2 filename. Ask for a pattern repeatedly until the user enters end.mysearch3 f1 ... fn. Search the supplied files for each entered pattern.Where does each loop belong? What happens when input reaches EOF?