How else can I identify files and directories?
An absolute path is like a latitude and longitude: it has the same value no matter where you are. A relative path, on the other hand, specifies a location starting from where you are: it's like saying "20 kilometers north".
As examples:
- If you are in the directory
/home/repl, the relative pathseasonalspecifies the same directory as the absolute path/home/repl/seasonal. - If you are in the directory
/home/repl/seasonal, the relative pathwinter.csvspecifies the same file as the absolute path/home/repl/seasonal/winter.csv.
The shell decides if a path is absolute or relative by looking at its first character: If it begins with /, it is absolute. If it does not begin with /, it is relative.
Deze oefening maakt deel uit van de cursus
Introduction to Shell
Praktische interactieve oefening
Zet theorie om in actie met een van onze interactieve oefeningen.
Begin met trainen