Enhance your command line basics with this comprehensive guide, perfect for those pursuing careers in web development, data science, Python coding, and web design. Discover how to navigate through folders in terminal windows, bring up previous commands, and cancel current commands among other crucial skills.
Key Insights
- The guide provides step-by-step instructions on how to navigate the Command Line, including accessing specific folders like Hipstirred-Website via the Terminal on Mac or the Command Prompt or Git Bash on Windows.
- Commands such as cd are used to navigate to specific folders, while commands like ls (Mac / Git Bash on Windows) or dir (Command Prompt on Windows) allow you to view the contents of a folder.
- The Up Arrow key can be used to bring up the last terminal command used, saving valuable time by reducing the need to re-type previous commands.
- The guide also provides a useful tip to cancel a current command by pressing Ctrl-C (for both Mac and Windows), allowing you to start on a new, clean command line if mistakes are made.
- For Mac users, there is a quicker way to navigate to a specific folder in the terminal by holding down the Cmd key and dragging the folder onto the terminal. This changes the terminal to that folder without any additional actions needed.
- Beyond mastering Git, the guide also points to a suite of coding courses offered in web development, Python, data science, and web design, suitable for hands-on learners who prefer a small class setting with expert-led instructions.
While there is a lot you can do via the command line interface, the main thing you need to know how to do for Git is to navigate to a folder.
Command Line Basics
1. On your Desktop, go into the Class Files > Git Class. Make sure you can see the Hipstirred-website folder. Keep this window open.
2. To access the command line, do the following instructions for your platform:
Mac: Go to Applications > Utilities and open Terminal.app.
Windows: If you're already familiar with the Windows Command Prompt and prefer it, launch that app. Otherwise, launch Git Bash, which may be an icon on your Desktop, or in the Windows Start menu (possibly in a Git folder).
3. Please note that from now on when we say terminal window, we are generically referring to the Terminal, Command Prompt, or Git Bash window.
4. In the terminal window, type cd and a space.
5. While we could type out the file path to the folder we want to navigate to, let's see a more graphical approach. Arrange the windows so you can see the Hipstirred-website folder and the terminal window at the same time.
6. Drag the Hipstirred-website folder into the terminal window and it should type out the path for you. Your command should now read something like (your path will vary based on your computer and terminal app):
Cd /Users/dan/Desktop/Class\ Files/Hipstirred-website
7. Click on the terminal window and hit Return (Mac) or Enter (Windows) to navigate to that folder. 8. To see the contents of this folder, use the following command:
Mac: Type ls and hit Return.
Windows using Git Bash: Type ls and hit Enter.
Windows using Command Prompt: Type dir and hit Enter.
Tip: Bring up Previous Commands
In the terminal, you can press the Up Arrow key to bring up the last terminal command you used. Keep pressing Up Arrow again to flip through your previous commands. This can be a great time saver!
Tip: Cancel the Current Command
As you type a command you may make mistakes. If you want to, you can cancel the current command, press the CTRL–C (Mac & Windows) and you'll be placed on a new, clean command line.
Tip for Mac Users
There's an even quicker way to navigate the terminal to a specific folder. With your terminal prompt empty (do not type anything in it) hold Cmd and drag a folder onto the terminal. That's it! No need to hit Return or anything else, the terminal will have changed to that folder and you're ready to go!
Go Beyond Git
We offer a full suite of coding courses. Classes are small, hands-on, and expert-led. Check out our coding bootcamps and courses now: