Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions act1.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# 1. In this directory, create a new directory called star_wars. Example answer: mkdir star_wars
mkdir star_wars
# 2. In the star_wars folder, create two new directories: empire and rebellion (This can be done in two commands, but how would you do it in one?)

cd star_wars && mkdir empire rebellion
# 3. Inside the empire directory, create a file called darth_vader.txt

cd empire && touch darth_vader.txt
# 4. Use the force (or your echo) to add the text "...heavy breathing..." to the darth_vader.txt file (Don’t remember how to do this? Use the ‘other force’, known as Google!)

echo "...heavy breathing..." > darth_vader.txt
# 5. Inside the empire directory, create a file called emperor_palpatine.txt

touch emperor_palpatine.txt
# 6. Inside the empire directory, create a directory called death_star

mkdir death_star
# 7. Move darth_vader.txt into the death_star
mv darth_vader.txt death_star
13 changes: 7 additions & 6 deletions act2.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
# 1. Inside the `star_wars/rebellion` directory, (IN ONE COMMAND) create a file called princess_leia.txt with the text "Help me, Obi-Wan…You’re my only hope."

echo "Help me, Obi-Wan...You're my only hope." >> ../rebellion/princess_leia.txt
# 2. Create a file called obi_wan.txt in star_wars/rebellion

cd ../rebellion && touch obi_wan.txt
# 3. Create a file in star_wars/rebellion called luke_skywalker.txt

touch luke_skywalker.txt
# 4. Create a directory in star_wars/rebellion called millenium_falcon

mkdir millenium_falcon
# 5. Inside the millenium_falcon, create two files: han_solo.txt and chewbacca.txt

cd millenium_falcon && touch han_solo.txt chewbacca.txt
# 6. Move luke_skywalker, obi_wan, and princess_leia into the millenium_falcon, respectively.

mv ../luke_skywalker.txt ../obi_wan.txt ../princess_leia.txt ./
# 7. Move the millenium_falcon into the death_star.
mv millenium_falcon ../empire/death_star
12 changes: 7 additions & 5 deletions act3.sh
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# 1. Unload the Millenium Falcon in ONE COMMAND!
# Move the whole crew from the millenium_falcon directory into the death_star directory. HINT: * following a directory will grab all files/folders inside of a directory (directory/*)

mv ../empire/death_star/millenium_falcon/* ../empire/death_star
# 2. darth_vader has defeated obi_wan! Delete poor obi_wan.

cd ../empire/death_star
rm obi_wan.txt
# 3. Our heroes have disabled the tractor beam! Move the whole crew back into the millenium_falcon!
# Remember: darth_vader remains in the death_star and emperor_palpatine is still in the empire.

mv ./chewbacca.txt ./han_solo.txt ./luke_skywalker.txt ./princess_leia.txt millenium_falcon
# 4. Move the millenium_falcon back into the rebellion directory.

mv millenium_falcon ../../rebellion
# 5. darth_vader leaves the death_star to pursue luke_skywalker! Move him from the death_star into the empire directory!

mv darth_vader.txt ../../empire
# 6. Thanks to his practice back home at Beggar’s Canyon, Luke blew up the death_star! Remove it from the galaxy!
rm -rf death_star
1 change: 1 addition & 0 deletions star_wars/empire/darth_vader.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
...heavy breathing...
Empty file.
Empty file.
Empty file.
Empty file.
1 change: 1 addition & 0 deletions star_wars/rebellion/millenium_falcon/princess_leia.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Help me, Obi-Wan...You're my only hope.