Exercise Solutions: TerminalΒΆ

  1. Use ls to view the contents of your Home directory.

    My-Computer:~ myusername$ ls
    

    Back to the exercises

  1. In the terminal, use mkdir to create a folder on the Desktop called 'my_first_directory'. Look on your Desktop. Do you see it?

    My-Computer:Desktop myusername$ mkdir my_first_directory
    

    Back to the exercises

  1. pwd to check your location.

    My-Computer:my_first_directory myusername$ pwd
    

    Back to the exercises

  1. Make a copy of your 'my_first_file.txt' from it's current spot to directly on the Desktop with cp my_first_file.txt ../my_first_copy.txt.

    My-Computer:my_first_directory myusername$ cp my_first_file.txt ../my_first_copy.txt
    

    Back to the exercises

  1. Use ls in the terminal to verify your 'my_first_copy.txt' on your Desktop. Open it up. Is it the same as your first file?

    My-Computer:Desktop myusername$ ls
    

    Back to the exercises

  1. Use ls to see that the copied file is no longer on your Desktop.

    My-Computer:Desktop myusername$ ls
    

    Back to the exercises

  1. cd .. to get back out to your Desktop.

    My-Computer:my_first_directory myusername$ cd ..
    

    Back to the exercises