Tools Tutorial menu

The Terminal

The terminal (also called the command line or shell) lets you control your computer by typing commands. Developers use it every day to run projects, install packages and use Git.

Why Use the Terminal?

Many developer tools have no buttons; they only work from the terminal. Examples are npm, git, python, php, dotnet and deployment tools. Once you know 10 basic commands, the terminal is often faster than clicking.

Opening a Terminal

SystemTerminal
WindowsPowerShell, Windows Terminal, or Git Bash (installed with Git)
macOSTerminal (search with Cmd+Space)
LinuxTerminal (Ctrl+Alt+T on Ubuntu)
AnyThe terminal inside VS Code: Ctrl+Backtick

The commands below work in Git Bash, macOS, Linux and mostly in PowerShell too.

Where Am I?

The terminal always works inside one folder, the current directory.

Example

bash
pwd
ls
Output
/home/ayesha/projects
bakery-site  notes.txt  portfolio
  • pwd prints the current folder (print working directory)
  • ls lists the files and folders in it (ls -la also shows hidden files)

Moving Around

Example

bash
cd bakery-site
pwd
cd ..
cd ~
Output
/home/ayesha/projects/bakery-site
CommandGoes to
cd folderA folder inside the current one
cd ..One level up
cd ~Your home folder
cd /The top of the drive
cd -The previous folder

Press Tab to complete folder and file names. Type cd bak and press Tab, and the terminal finishes bakery-site for you. It saves time and avoids typing mistakes.

Files and Folders

Example

bash
mkdir new-site
cd new-site
touch index.html style.css
ls
Output
index.html  style.css
CommandWhat it does
mkdir nameMake a folder
touch fileCreate an empty file (Git Bash, macOS, Linux)
cp a.txt b.txtCopy a file
cp -r folder copyCopy a folder
mv old.txt new.txtRename or move
rm fileDelete a file
rm -r folderDelete a folder and everything inside
cat fileShow what is inside a file
code .Open the current folder in VS Code

rm deletes files permanently. They do not go to the Recycle Bin. Double-check before pressing Enter.

Useful Shortcuts

KeyAction
Up / Down arrowsRepeat previous commands
TabComplete a name
Ctrl+CStop the running program (like a dev server)
Ctrl+L or clearClear the screen
Ctrl+RSearch your command history

Running Programs

Most tools you install add a command to the terminal. Check versions to confirm they work:

Example

bash
node --version
git --version
python --version
Output
v22.11.0
git version 2.47.0
Python 3.12.7

If you see "command not found" or "is not recognized", the tool is not installed, or the terminal needs to be restarted after the installation.

Flags and Help

Many commands accept flags that change how they work, like -la in ls -la. To learn a command's options, use:

Example

bash
git --help
ls --help

Exercise

Exercise

Which command moves you one folder up?

Learn Tools with a teacher

Join the Full Stack Development course at Workownix, online or in Orangi Town, Karachi, and get a certificate.

See the course Ask on WhatsApp