Skip to content

Instantly share code, notes, and snippets.

@femmestem
Last active August 29, 2015 13:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save femmestem/9045659 to your computer and use it in GitHub Desktop.
Save femmestem/9045659 to your computer and use it in GitHub Desktop.
Phase 0 Week 6: Command Line Obstacle Course
# Clone the directory and view files
git clone https://github.com/femmestem/CLI-Obstacle-Course.git
cd CLI-Obstacle-Course
ls
ls -ald
# Move files and directories
mv images app/assets/images
ls -a
cd app/views/static_pages
ls
ls ./..
ls ./../..
mv this_is_the_annoying_ping_pong_text\!.txt ../this_is_the_annoying_ping_pong_text\!.txt
mv ../this_is_the_annoying_ping_pong_text\!.txt this_is_the_annoying_ping_pong_text\!.txt
mv where_am_you\?.txt where_am_i\?.txt
# Output to file
pwd > where_am_i\?.txt
find /*/ -name static_pages_controller.rb
mv static_pages_controller.rb ../controllers/static_pages_controller.rb
# Searching...
find /*/ -name *controller*
find . -name "*"|xargs grep bootinator
cd app/assets/stylesheets/
mv application_helper.rb ../../helpers/application_helper.rb
rm -r delete_me
# Winning.rb
find . -name "*winning.rb"
cp ./config/environments/you_are_winning.rb you_are_winning.rb
ruby you_are_winning.rb
history
# This is one of the most fun Dev Bootcamp exercises I've done thus far!

#Objectives ##Clone the directory and view files

  1. Clone the repository provided.
  2. Move into the repo directory (it should be called CLI-Obstacle-Course.
  3. View the directories and files that are created.
  4. View all the files with time stamp and owner permissions (including hidden files).

##Move files and directories

  1. Move the images directory into the app/assets directory, and list its contents including hidden files.
  2. Go into the app directory then into the views directory then into the static_pages directory.
  3. View the files in that directory. Without changing directory, view the files in the parent directory. View the files in the parent's parent directory.
  4. Move the file this_is_the_annoying_ping_pong_text!.txt into the parent directory.
  5. Now without changing directories, move it back to views/static_pages/.
  6. Change the file's name to where_am_you?.txt, then change the name to where_am_i?.txt.

##Output to file

  1. View your working directory path.
  2. Copy the working directory path into where_am_i?.txt (don't use TextMate or any other outside application to do this!).
  3. Go back to the home directory using one command.
  4. Find the file named with static_pages_controller.rb and move it into the app/controllers/ directory.

##Searching...

  1. View all the filenames that have controller in the title.
  2. Find the file that has the bootinator method in it.
  3. Move that file into the app/helpers/ directory.
  4. Delete the directory delete_me/ from the main directory (including all its contents. careful!).

##Winning.rb

  1. Find a ruby file whose title ends with the text winning.rb.
  2. Copy that file to your home directory, and go to your home directory.
  3. Run the file using the ruby command.
  4. Read what the file tells you to do, and do it as soon as you can!

##Submit There are hidden instructions in the obstacle course that will instruct you how to submit this challenge.

The instructions will require you to save all the previous steps, so make sure you don't skip any!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment