Skip to content

Instantly share code, notes, and snippets.

@mdang
Last active May 31, 2017 14:14
Show Gist options
  • Select an option

  • Save mdang/7b025b4188aea93dbde2 to your computer and use it in GitHub Desktop.

Select an option

Save mdang/7b025b4188aea93dbde2 to your computer and use it in GitHub Desktop.
Exercise: Lion King

The Lion King (CLI)

20 min

Let's get some practice with some basic CLI commands. See how far you can get with this exercise before we move on!

For this exercise, create a directory called thelionking in a temporary directory and cd into it. Everything below goes inside of it.

  1. Create a directory called pridelands in thelionking
  2. Change directories into pridelands
  3. Create files mufassa.txt, scar.txt, simba.html, and rafiki.js in the pridelands directory
  4. Create a directory called elephantgraveyard in thelionking
  5. Add a file named hyenas.txt to the elephantgraveyard
  6. Move simba.html to the elephantgraveyard
  7. Move mufassa.txt to the elephantgraveyard
  8. Create a directory named thegorge in the thelionking
  9. Move hyenas.txt to thegorge
  10. Move simba.html and scar.txt to thegorge
  11. Create a file named stampede.md
  12. Move mufassa.txt to thegorge
  13. Delete stampede.md
  14. Delete mufassa.txt
  15. Move scar.txt and hyenas.txt to pridelands
  16. Create a directory named thejungle in thelionking
  17. Copy simba.html from thegorge to thejungle
  18. Create files named timon.txt and pumba.css in thejungle directory
  19. Rename the simba.html copy to matthewbrodericksimba.txt
  20. Delete simba.html from thegorge
  21. Delete thegorge
  22. Move rafiki.js to thejungle
  23. Move matthewbrodericksimba.txt, timon.txt, pumba.css, and rafiki.js to pridelands
  24. Delete directory thejungle
  25. Delete scar.txt
  26. Add file circleoflife.txt to pridelands

Cheatsheet

  • mkdir DIRECTORY_NAME - Create a directory
  • touch FILE_NAME - Create a new file
  • cd DIRECTORY_NAME - Change directories
  • mv FILE_PATH NEW_FILE_PATH - Move a file or folder
  • rm FILE_NAME - Delete a file or folder
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment