- Do more reps to become comfortable navigating the CLI.
- Open your terminal, in the root directory create a directory called
code
. This is where you can put all your code for any projects, in and out of this class. - In the
code
directory create another directory calledwdi
, this will be where we put all content for this class. - In the
WDI
directory create 4 more directories calledlabs
,lessons
,projects
,misc
. Your file structure is complete! We'll continue to use these directories to stay organized throughout the class. Now that we're ready, let's create a directory for this lab: - Navigate to the path
~/code/wdi/labs
and create a new directory calledsimpsons
where we will do all of the following work:
The more practice you have working in the terminal manipulating files and directories the better!
The Simpsons are your average American family living in Springfield. Let's create the family's hometown, create a directory called springfield
and cd
into it. Once you've navigated into the directory let's create the family members, create the following files in your springfield
folder:
-Homer.txt
-Marge.txt
-Bart.txt
-Lisa.txt
-Maggie.txt
- When the show's intro starts the camera pans through the clouds and over the entire town. The view then focuses through the window of the elementary school where we find Bart in detention writing out whatever horrible deed he accomplished that day. Create a directory called
school
and moveBart.txt
inside of it. - Next the camera pans to the nuclear power plant where we find Homer mishandling what appears to be a radioactive core sample. Create a directory
power-plant
and moveHomer.txt
into it. - Homer forgot his employee ID, so he needs to get a temporary pass. Let's use the 'echo' command to APPEND some text in the
Homer.txt
that says 'Work Pass: Homer J. Simpson' - Use the 'grep' command to search
Homer.txt
for the phrase "Work Pass" just to be sure it is there. - Then we find Marge and Maggie together in the super market. Create a
market
directory and move Marge and Maggie inside it. - The camera then pans to the band room in the school where we find Lisa crushing a sax solo. Traverse to the
school
directory, create aband-room
directory, and moveLisa.txt
into theband-room
directory. Can you do this without leaving theschool
directory? - We then find the family making their way home through the streets of springfield; Homer in his pink car, Marge and Maggie in the red car, and Bart on his skateboard. Traverse back to the
springfield
directory and create the directories for the each mode of transportation, and then place each respective party in that directory. - The family finally makes their way back home and the hilarious couch gag ensues. Create a
home
directory inside ofspringfield
and then create acouch
directory withinhome
. Then Move ALL of the family members tocouch
. BONUS - can you move the family members without going into any of the springfield sub-directories? (HINT - use relative paths! If inspringfield
directory, what doesls
return? How aboutls power-plant
?)