← Back to Tutorials

Beginner’s Guide: Getting Started with the Basics

beginner guidegetting startedbasicshow tointroduction

Beginner’s Guide: Getting Started with the Basics

This tutorial is a practical, command-heavy introduction to core “getting started” skills that transfer across many technical paths: working in a terminal, navigating your computer, managing files, installing software, using Git, and writing your first small scripts. The goal is not to memorize commands, but to understand what they do, why they exist, and how to combine them safely.


1) What you’re learning (and why it matters)

Most beginner guides jump straight into a specific technology. This guide focuses on universal fundamentals:

These basics make everything else easier: web development, data science, DevOps, security, and general productivity.


2) Setup: choose your environment

Option B: Linux (Ubuntu/Debian examples)

Option C: Windows

You have two good routes:

  1. WSL (Windows Subsystem for Linux): best for learning Unix commands.
  2. PowerShell: great, but different commands than Linux/macOS.

This tutorial uses Unix-like commands (Linux/macOS/WSL). If you’re on Windows without WSL, install WSL:

wsl --install

Then open “Ubuntu” from the Start menu.


3) Terminal basics: how commands work

A terminal is a text-based interface where you type commands. Most commands follow a pattern:

command [options] [arguments]

Your first commands

Check where you are:

pwd

List files:

ls

List with details:

ls -l

List including hidden files (names starting with .):

ls -la

Understanding output (important)

In ls -l, you’ll see columns like:

Don’t worry about memorizing—just recognize that commands often have “verbose” modes to show more context.


4) Navigating directories

Change directory:

cd /path/to/folder

Go to your home directory:

cd

Go up one level:

cd ..

Go to the previous directory:

cd -

Paths: absolute vs relative

A very common beginner mistake is confusing these. If a command says “No such file or directory,” verify:

  1. Are you in the directory you think you are? (pwd)
  2. Does the file exist? (ls)
  3. Is the path correct (spelling/case)?

5) Creating, moving, copying, deleting (safely)

Create directories

mkdir projects

Create nested directories in one go:

mkdir -p projects/demo/src

Create files

Create an empty file:

touch notes.txt

Write text into a file (overwrite):

echo "Hello, world" > hello.txt

Append text:

echo "Another line" >> hello.txt

View file content:

cat hello.txt

View with paging (use q to quit):

less hello.txt

Copy files and directories

Copy a file:

cp hello.txt hello-copy.txt

Copy a directory recursively:

cp -r projects projects-backup

Move / rename

Rename a file:

mv hello-copy.txt hello-renamed.txt

Move into a folder:

mv hello-renamed.txt projects/demo/

Delete (be careful)

Delete a file:

rm notes.txt

Delete a directory recursively:

rm -r projects-backup

Safety tip: rm is permanent (no recycle bin by default). Before deleting, you can preview what you’re targeting:

ls -la projects-backup

If you want an interactive prompt before each delete:

rm -ri projects-backup

6) Searching and inspecting your system

Find files by name

Search under the current directory:

find . -name "hello.txt"

Case-insensitive search:

find . -iname "hello.txt"

Search under your home directory:

find ~ -name "*.txt"

Search inside files (grep)

Search for a word in a file:

grep "Hello" hello.txt

Search recursively in a directory:

grep -R "TODO" projects

Show line numbers:

grep -n "TODO" -R projects

Why this matters: as projects grow, you need to locate definitions, configuration flags, or error messages quickly.

Inspect commands and documentation

Most Unix tools have built-in help:

ls --help

Manual pages (often more detailed):

man ls

Search for a man page keyword:

man -k network

7) Understanding permissions (read/write/execute)

Permissions determine who can read, write, or execute files.

Check permissions:

ls -l

You’ll see something like:

-rw-r--r--  1 user  group  1234 Apr  3 10:00 file.txt

The first chunk -rw-r--r-- means:

Making a script executable

Create a script:

echo 'echo "Running a script"' > run.sh

Try running it:

./run.sh

You may get “Permission denied.” Fix it:

chmod +x run.sh

Now run again:

./run.sh

Why “execute” matters


8) Installing software with package managers

Package managers install tools and keep them updated.

Linux (Debian/Ubuntu): apt

Update package lists:

sudo apt update

Install a package:

sudo apt install git curl

Upgrade installed packages:

sudo apt upgrade

macOS: Homebrew

Install Homebrew (from brew.sh). Typically:

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

Install packages:

brew install git curl

Update:

brew update
brew upgrade

What is sudo?

sudo runs a command with administrator privileges. Use it carefully:


9) Git fundamentals: track changes and undo mistakes

Git is a version control system. Think of it as:

Configure Git once

git config --global user.name "Your Name"
git config --global user.email "you@example.com"

Check config:

git config --global --list

Create a new project and initialize Git

mkdir -p projects/first-repo
cd projects/first-repo
git init

Create a file:

echo "# My First Repo" > README.md

Check status:

git status

Stage changes (prepare them for commit):

git add README.md

Commit:

git commit -m "Add README"

View history:

git log --oneline

The mental model: working tree → staging area → commits

This model is why Git feels confusing at first, but it’s powerful: you can stage only part of your changes.

Make and commit more changes

echo "Some notes" > notes.txt
git add notes.txt
git commit -m "Add notes file"

Undoing common mistakes

1) You edited a file but want to discard changes

git checkout -- notes.txt

Newer Git also supports:

git restore notes.txt

2) You staged something by accident

git restore --staged notes.txt

3) You want to undo the last commit but keep the changes

git reset --soft HEAD~1

4) You want to undo the last commit and discard changes Be careful:

git reset --hard HEAD~1

Branching: try changes safely

Create and switch to a new branch:

git switch -c experiment

Make a change:

echo "Experiment line" >> README.md
git add README.md
git commit -m "Experiment with README"

Switch back:

git switch main

If your default branch is master, use that instead of main.

Merge the experiment branch:

git merge experiment

Delete the branch (optional):

git branch -d experiment

10) Editing text files (practical options)

You need a way to edit configuration and code.

Option A: nano (beginner-friendly terminal editor)

Open a file:

nano README.md

If installed, you can open the current folder:

code .

If code is not found, install VS Code and enable the “Shell Command: Install ‘code’ command in PATH” option.


11) Environment variables and your PATH

Environment variables are key-value settings that affect programs.

View a variable:

echo $HOME

Common variables:

View your PATH:

echo $PATH

Why PATH matters

When you run:

git

Your shell searches directories listed in PATH to find the git executable. If a command is “not found,” it may not be installed or not in PATH.


12) Basic networking commands (useful for troubleshooting)

Check if a host is reachable:

ping -c 4 google.com

Fetch a web page:

curl -I https://example.com

Download a file:

curl -L -o example.html https://example.com

Check your IP info (varies by system):

ip a

On macOS, try:

ifconfig

13) Processes: see what’s running and stop it

List processes:

ps aux | less

Find a process by name:

ps aux | grep python

Interactive process viewer (if installed):

top

Or:

htop

Stop a process by PID:

kill 12345

Force stop (last resort):

kill -9 12345

Why this matters: sometimes programs freeze, bind to a port, or consume CPU. Knowing how to inspect and stop them is essential.


14) A gentle introduction to scripting

Scripting means writing a file that runs a sequence of commands.

Bash script example: create a project skeleton

Create a script:

mkdir -p projects/scripts
cd projects/scripts
nano make_project.sh

Paste:

#!/usr/bin/env bash
set -e

if [ -z "$1" ]; then
  echo "Usage: $0 <project-name>"
  exit 1
fi

NAME="$1"

mkdir -p "$NAME"/{src,tests,docs}
touch "$NAME"/README.md
echo "# $NAME" > "$NAME"/README.md

echo "Created project structure for: $NAME"

Make it executable:

chmod +x make_project.sh

Run it:

./make_project.sh demo-app

Inspect results:

ls -R demo-app
cat demo-app/README.md

Explanation of key lines


15) A tiny Python script (optional but useful)

If Python is installed:

python3 --version

Create a folder:

mkdir -p projects/python-demo
cd projects/python-demo

Create a script:

cat > hello.py << 'EOF'
import sys

name = sys.argv[1] if len(sys.argv) > 1 else "world"
print(f"Hello, {name}!")
EOF

Run it:

python3 hello.py
python3 hello.py Alice

This demonstrates:


16) Putting it together: a realistic mini-workflow

You’ll create a project, track it with Git, and automate a task.

Step 1: create project and initialize Git

mkdir -p projects/workflow-demo
cd projects/workflow-demo
git init

Step 2: add files

echo "# Workflow Demo" > README.md
mkdir src
echo 'print("hello")' > src/app.py

Step 3: commit

git add .
git commit -m "Initial project structure"

Step 4: make a change and inspect differences

echo 'print("goodbye")' >> src/app.py
git diff

Stage and commit:

git add src/app.py
git commit -m "Add goodbye line"

Step 5: tag a version (common in releases)

git tag v0.1.0
git tag

17) Common beginner errors and how to recover

“Permission denied”

“Command not found”

which git
which python3

“No such file or directory”

You deleted something important

git checkout -- path/to/file

If it wasn’t tracked, recovery is harder. This is why version control and backups matter.


18) Next steps: where to go from here

Once you’re comfortable with the basics above, you can expand in several directions:

A strong practical goal: pick a small personal project and use terminal + Git for everything. The repetition will make the commands feel natural.


Appendix: Command cheat sheet (with meaning)

TaskCommandMeaning
Where am I?pwdPrint current directory
List filesls -laList all files (incl hidden) with details
Change directorycd pathMove into a folder
Make foldermkdir -p a/bCreate nested directories
Create filetouch file.txtMake empty file
View fileless file.txtRead with paging
Copycp src dstCopy file
Move/renamemv old newMove or rename
Deleterm -ri folderInteractive recursive delete
Find by namefind . -iname "*.md"Search files by name
Search in filesgrep -R "text" .Search content recursively
Helpman cmdManual page
Install (Ubuntu)sudo apt install gitInstall package
Install (macOS)brew install gitInstall package
Git statusgit statusShow changes
Git commitgit commit -m "msg"Save snapshot
Git diffgit diffShow unstaged differences
Branchgit switch -c nameCreate and switch branch

If you want, tell me your OS (Windows/macOS/Linux) and what you’re trying to build (web app, automation, data analysis, etc.), and I can tailor a follow-up “next tutorial” with a focused project and the exact commands to run.