Practise navigating a file structure from command line.
- Make sure you have git installed
- Open Terminal (Command Line on Windows)
- Clone this repository (instructions below)
- Change directory into this repository
cd CLINavigationPractice
You can Clone this repository using SSH or HTTPS.
git clone https://github.com/susiecoleman/CLINavigationPractice.git
If you use SSH you need to generate an SSH key first using this guide. Then do git clone [email protected]:susiecoleman/CLINavigationPractice.git
Answer the following questions by navigating the file tree
- How many images of camels are there?
- How many years does the average emperor penguin live for?
- When is penguin awareness day?
- What do camels eat?
- How many breeds of dog are there?
- Which pug image features a puppy wearing a hat?
cd DirectoryName
- Change the current working directory.
ls
- List all the files in the current working directory
pwd
- Print the current working directory
open fileName
- Open the file.
cd ..
- Navigate to the directory above the current working directory.
cat fileName
- Prints the contents of filename to the terminal window.
If your file name or directory name has spaces in it you will need to include a \
otherwise the terminal will think it is the start of new command. e.g. cd my\ directory
c:
Change to the C drive
cd MyDirectory
Move from your current directory to MyDirectory
cd ..
Move up a directory
cd
Show the directory you’re currently in. The equivalent of pwd on a unix machine
dir
Show the contents of the current directory. The equivalent of ls on a unix machine.
type fileName
- Prints the contents of filename to the terminal window.
If your file name or directory name has spaces in it you will need to surround the name with double quotes otherwise the terminal will think it is the start of new command. e.g. cd "my directory"
In windows 10.1 it is now possible run bash. Set up instructions