Current Level: 1 | 2 | 3 | 4 | 5 | 6 | 7
Learn to create, move, and delete files and folders from the command line β while following best practices for naming and structure.
Open your terminal and run:
pwd
β Confirms your current location. You should be in the shell-lesson-data
folder.
Move into the exercise-data/writing
directory:
cd exercise-data/writing
ls -F
β Youβll see files like haiku.txt
, LittleWomen.txt
.
Make a new directory named thesis
:
mkdir thesis
Check that it was created:
ls -F
ls -F thesis
Make a nested structure in one command using -p
:
mkdir -p ../project/data ../project/results
View the hierarchy:
ls -FR ../project
Donβt use spaces in names:
mkdir north pacific gyre
β This actually creates three folders: north/
, pacific/
, and gyre/
. Instead, do this:
mkdir north-pacific-gyre
Avoid starting names with a dash (-
), which the shell interprets as an option.
Stick with letters, numbers, -
, _
, and .
in names. Other characters (like *
or &
) have special meanings in Bash.
If you must use a name with spaces or symbols, wrap it in single quotes:
mkdir 'my folder with spaces'
This lesson builds your confidence using the shell to organize work and reinforces how naming affects your ability to navigate and automate tasks.