Skip to content

Commit

Permalink
update absolute vs relative path schematic
Browse files Browse the repository at this point in the history
  • Loading branch information
DininduSenanayake committed Jul 30, 2024
1 parent a0a2c20 commit 0943c54
Showing 1 changed file with 14 additions and 19 deletions.
33 changes: 14 additions & 19 deletions docs/02-the-filesystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -266,34 +266,29 @@ Over time, it will become easier for you to keep a mental note of the
structure of the directories that you are using and how to quickly
navigate amongst them.

::::::::::::::::::::::::::::::::::::::: challenge

## Relative path resolution

Using the filesystem diagram below, if `pwd` displays `/Users/thing`,
what will `ls ../backup` display?
## Relative path resolution

1. `../backup: No such file or directory`
2. `2012-12-01 2013-01-08 2013-01-27`
3. `2012-12-01/ 2013-01-08/ 2013-01-27/`
4. `original pnas_final pnas_sub`
!!! dumbbell "Using the filesystem diagram below, if `pwd` displays `/Users/thing`," what will `ls ../backup` display?"

![](fig/filesystem-challenge.svg){alt='File System for Challenge Questions'}
1. `../backup: No such file or directory`
2. `2012-12-01 2013-01-08 2013-01-27`
3. `2012-12-01/ 2013-01-08/ 2013-01-27/`
4. `original pnas_final pnas_sub`

::::::::::::::: solution
![](fig/filesystem-challenge.svg){alt='File System for Challenge Questions'}

## Solution

1. No: there _is_ a directory `backup` in `/Users`.
2. No: this is the content of `Users/thing/backup`,
but with `..` we asked for one level further up.
3. No: see previous explanation.
Also, we did not specify `-F` to display `/` at the end of the directory names.
4. Yes: `../backup` refers to `/Users/backup`.
??? success "Solution"

:::::::::::::::::::::::::
1. No: there _is_ a directory `backup` in `/Users`.
2. No: this is the content of `Users/thing/backup`,
but with `..` we asked for one level further up.
3. No: see previous explanation.
Also, we did not specify `-F` to display `/` at the end of the directory names.
4. Yes: `../backup` refers to `/Users/backup`.

::::::::::::::::::::::::::::::::::::::::::::::::::

### Navigational Shortcuts

Expand Down

0 comments on commit 0943c54

Please sign in to comment.