Rocket Academy Bootcamp
  • 🚀Welcome to Bootcamp!
  • 🛠️Logistics
    • Course Schedules
    • Course Methodology
    • Required Software
    • LinkedIn Education Badge
  • 📚General Reference
    • Naming, Casing, and Commenting Conventions
    • VS Code Tips
    • Recommended Resources
  • 🪨0: Foundations
    • 0.1: Command Line
    • 0.2: Git
      • 0.2.1: Branches
    • 0.3: GitHub
      • 0.3.1: Pull Requests
    • 0.4: JavaScript
      • 0.4.1: ES6
      • 0.4.2: Common Syntax
      • 0.4.3: Reference vs Value
      • 0.4.4: Classes
      • 0.4.5: Destructuring and Spread Operator
      • 0.4.6: Promises
        • 0.4.6.1: Async Await
    • 0.5: Node.js
      • 0.5.1: Node Modules
      • 0.5.2: NPM
      • 0.5.3: Nodemon
  • 🖼️1: Frontend
    • 1.1: HTML
    • 1.2: CSS
      • 1.2.1: Layout
    • 1.3: React
      • Styling in ReactJs
      • Using Styling Libraries with React
      • React Deployment
    • 1.E: Exercises
      • 1.E.1: Recipe Site
      • 1.E.2: Portfolio Page
      • 1.E.3: World Clock
      • 1.E.4: High Card
      • 1.E.5: Guess The Word
    • 1.P: Frontend App
  • 🏭2: Full Stack
    • 2.1: Internet 101
      • 2.1.1: Chrome DevTools Network Panel
      • 2.1.2: HTTP Requests and Responses
    • 2.2: Advanced React
      • 2.2.1: AJAX
      • 2.2.2: React Router
      • 2.2.3: useContext
      • 2.2.4: useReducer
      • 2.2.5: Environmental Variables
      • 2.2.6: React useMemo - useCallback
    • 2.3: Firebase
      • 2.3.1: Firebase Realtime Database
      • 2.3.2: Firebase Storage
      • 2.3.3: Firebase Authentication
      • 2.3.4: Firebase Hosting
      • 2.3.5: Firebase Techniques
    • 2.E: Exercises
      • 2.E.1: Weather App
      • 2.E.2: Instagram Chat
      • 2.E.3: Instagram Posts
      • 2.E.4: Instagram Auth
      • 2.E.5: Instagram Routes
    • 2.P: Full-Stack App (Firebase)
  • 🤖3: Backend
    • 3.1: Express.js
      • 3.1.1 : MVC
    • 3.2: SQL
      • 3.2.1: SQL 1-M Relationships
      • 3.2.2: SQL M-M Relationships
      • 3.2.3: SQL Schema Design
      • 3.2.4: Advanced SQL Concepts
      • 3.2.5: SQL - Express
      • 3.2.6: DBeaver
    • 3.3: Sequelize
      • 3.3.1: Sequelize One-To-Many (1-M) Relationships
      • 3.3.2: Sequelize Many-To-Many (M-M) Relationships
      • 3.3.3: Advanced Sequelize Concepts
      • 3.3.4 Database Design
    • 3.4: Authentication
      • 3.4.1: JWT App
    • 3.5: Application Deployment
    • 3.E: Exercises
      • 3.E.1: Bigfoot JSON
      • 3.E.2: Bigfoot SQL
      • 3.E.3: Bigfoot SQL 1-M
      • 3.E.4: Bigfoot SQL M-M
      • 3.E.5: Carousell Schema Design
      • 3.E.6: Carousell Auth
    • 3.P: Full-Stack App (Express)
  • 🏞️4: Capstone
    • 4.1: Testing
      • 4.1.1: Frontend React Testing
      • 4.1.2: Backend Expressjs Testing
    • 4.2: Continuous Integration
      • 4.2.1 Continuous Deployment (Fly.io)
      • 4.2.2: Circle Ci
    • 4.3: TypeScript
    • 4.4: Security
    • 4.5: ChatGPT for SWE
    • 4.6: Soft Skills for SWE
    • 4.P: Capstone
  • 🧮Algorithms
    • A.1: Data Structures
      • A.1.1: Arrays
        • A.1.1.1: Binary Search
        • A.1.1.2: Sliding Windows
      • A.1.2: Hash Tables
      • A.1.3: Stacks
      • A.1.4: Queues
      • A.1.5: Linked Lists
      • A.1.6: Trees
      • A.1.7: Graphs
      • A.1.8: Heaps
    • A.2: Complexity Analysis
    • A.3: Object-Oriented Programming
    • A.4: Recursion
    • A.5: Dynamic Programming
    • A.6: Bit Manipulation
    • A.7: Python
  • 💼Interview Prep
    • IP.1: Job Application Strategy
    • IP.2: Resume
    • IP.3: Portfolio
Powered by GitBook
On this page
  • Learning Objectives
  • Introduction
  • Common Commands
  • Common Special Paths
  • Exercise
  • Additional Resources
  1. 0: Foundations

0.1: Command Line

Previous0: FoundationsNext0.2: Git

Last updated 1 year ago

Learning Objectives

  1. The command line is a text interface for manipulating our computers

  2. Navigate folders and display folder contents in the command line

  3. Create new folders and files in the command line

  4. Rename or delete folders and files in the command line

Introduction

The command line, also known as "terminal" is a text-based computer interface. We will use the command line to manage files, use Git version control and run Node applications. Using the command line is separate from writing application code, though we will need the command line to build apps effectively.

If you are a Windows user, please use the VS Code terminal connected to Ubuntu in WSL. The Windows Command Prompt runs PowerShell by default which is not compatible with Unix-based commands that most software engineers use. See for details.

Common Commands

Below, we have listed some of the most commonly used terminal commands that software engineers use. To learn more about these commands, google "man" followed by the command name to get the "manual" page for the command (eg. to learn more about "pwd", simply enter "man pwd" into google).

Tab Complete

The command line will autocomplete file and folder names if we press tab after starting to type their names. This can save us a lot of typing!

Command
Meaning
Sample Usage
Explanation

pwd

Present working directory

pwd

Retrieve the "absolute path" of the current folder (directory). Absolute means relative to the root folder of your hard drive.

ls

List

ls

List the files and folders in the current folder

cd

Change directory

cd rocket/project1

Move to the specified folder. If we do not specify a folder, cd will move us to the current user's home folder. To move to the parent folder, use cd ... The 2 dots are a special path referencing the parent folder.

mkdir

Create folder

mkdir components

Create a new folder at the specified path

cp

Copy

File: cp App.js newComponent.js Folder: cp -r components components-new

Copy the contents of the first file to the second, overwriting contents of the second if any. Use cp -r (recursive flag) to copy folders.

mv

Move

Move: mv App.js components

Rename: mv App.js index.js

Move the 1st argument to the 2nd argument. If the 2nd argument is a folder, move the 1st argument inside the 2nd argument.

Otherwise, rename the 1st argument to be the 2nd argument.

rm

Remove

File: rm unnecessary-file.txt Folder: rm -r unnecessary-folder

Delete a file or folder. This is irreversible and there is no trash folder.

Be very careful, and if you delete the root folder / you may have to reformat your computer.

Common Special Paths

The following paths are shortcuts to common locations and are often used in folder navigation.

Path
Meaning
Sample Usage
Explanation

/

Root, i.e. the highest-level folder on our computers

cd /Users/joe/rocket/project1

All absolute paths begin with the root folder /

~

Home, i.e. the logged-in user's home folder

cd ~

~ is an alias for /Users/username, where username is the username of the logged-in user

..

Parent folder

cd ..

Every folder has a hidden link .. that references the parent folder. cd .. changes directory to the parent folder without having to reference the name of the parent folder.

.

Current folder

mv components/App.js .

. is most commonly used to move files or folders from elsewhere to the current folder

Exercise

Run each of the above commands with local files and folders. Verify file and folder changes in Ubuntu File Manager or MacOS Finder.

Additional Resources

The following is a command line tutorial from a previous version of Rocket's Coding Basics course.

🪨
Windows Command Line Setup