-
-
Notifications
You must be signed in to change notification settings - Fork 1k
Description
How could the content be improved?
During my teaching demo, I found that when we introduce the mkdir -p concept it was confusing (and the instructor also agreed). I also saw there was another issue raised about this section in April.
When we say:
Note that mkdir is not limited to creating single directories one at a time. The -p option allows mkdir to create a directory with nested subdirectories in a single operation:
$ mkdir -p ../project/data ../project/results
It is pretty confusing for the following reasons:
- We are combining two different concepts that may be overlooked. We are using the
-pcommand (without explaining what it actually stands for) and we are creating two directories at the same time. The main idea about how-pallows you to create directories in a different location might be overlooked. - We never
cdinto the/projectdirectory first to show what the current folders/files are, therefore it is not super straight forward that it actually created them. - We also never end up using these directories.
A few suggestions could be something like we first cd ../projects and then ls to show the contents. Then we cd ../ and pwd to show that we are in /Users/nelle/Desktop/shell-lesson-data/exercise-data/. Then introduce the path idea (without the ../) so it would be mkdir -p /projects/data. Followed by ls -FR project/.
Then if you wanted to show that you can make multiple directories at the same time (although, I don't think this is super important), then you could run mkdir -p projects/results projects/conclusions.
I personally almost never use the -p command but if we do want to teach it, then I think some reorganizing about this concept would be beneficial to the learners. Thanks!
Which part of the content does your suggestion apply to?
https://github.com/swcarpentry/shell-novice/blob/main/episodes/03-create.md