← Back to Tutorials

Beginner’s Guide: Getting Started with the Basics

beginner guidegetting startedbasicsintroductionhow to

Beginner’s Guide: Getting Started with the Basics

This tutorial is a practical, command-heavy introduction to core “getting started” skills that apply to most technical paths: using a terminal, navigating files, editing text, installing software, understanding permissions, and using Git. It assumes you are a beginner and explains why things work, not just what to type.


1) What You’re Learning (and Why It Matters)

When people say “learn the basics,” they usually mean:

These skills are foundational because they are transferable: whether you’re learning programming, data science, DevOps, cybersecurity, or web development, you will repeatedly rely on them.


2) The Terminal: Your Universal Control Panel

A terminal is a program that lets you type commands to your operating system. On macOS it’s called Terminal (or iTerm2), on Linux there are many, and on Windows you’ll likely use PowerShell or Windows Terminal.

2.1 Shell vs Terminal

Check your shell:

echo $SHELL

On Windows PowerShell, this won’t work the same way. In PowerShell:

$PSVersionTable

2.2 How Commands Are Structured

A typical command looks like:

command --option value argument

Example:

ls -l /etc

2.3 Getting Help (Don’t Skip This)

Most tools provide built-in help.

ls --help

Many Unix tools also have manual pages:

man ls

Inside man, press:


3) Files, Folders, and Paths

3.1 Where Am I?

Print your current directory:

pwd

3.2 Listing Files

ls
ls -la

3.3 Changing Directories

cd /path/to/folder
cd ..
cd ~
cd -

3.4 Absolute vs Relative Paths

If you’re in /home/alex and run:

cd projects/myapp

you end up at /home/alex/projects/myapp.

3.5 Creating, Moving, Copying, Deleting

Create a directory:

mkdir my_project
mkdir -p my_project/src

Create an empty file:

touch README.md

Copy:

cp README.md README.backup.md
cp -r src src_copy

Move/rename:

mv README.backup.md docs.md

Delete (be careful):

rm docs.md
rm -r src_copy
rm -rf build/

Important: rm -rf deletes recursively without prompting. There is no recycle bin by default.


4) Reading and Searching Text (Core Skill)

A huge amount of “real work” is reading logs, configs, and output.

4.1 Viewing Files

Print a file to the terminal:

cat README.md

Paginated view (recommended for long files):

less /var/log/system.log

In less, use:

View the start or end of a file:

head -n 20 README.md
tail -n 50 README.md

Follow a growing log file:

tail -f app.log

Stop with Ctrl+C.

4.2 Searching Inside Files with grep

Search for a word:

grep "TODO" README.md

Recursive search in a directory:

grep -R "password" .

Case-insensitive search:

grep -Ri "error" logs/

Show line numbers:

grep -n "main" src/app.py

4.3 Chaining Commands with Pipes

A pipe | sends output of one command into another.

Example: list files and filter:

ls -la | grep "\.md"

Count matching lines:

grep -R "TODO" . | wc -l

This is a core terminal superpower: small tools combined into powerful workflows.


5) Editing Text Files

You will constantly edit configuration files, scripts, and documentation.

5.1 A Beginner-Friendly Editor: VS Code (Optional but Common)

If you have VS Code installed, you can open a folder:

code .

If code is not found, you need to enable the shell command from VS Code:

5.2 Terminal Editors: nano and vim

nano is simple:

nano README.md

It shows shortcuts at the bottom (e.g., Ctrl+O to save, Ctrl+X to exit).

vim is powerful but has a learning curve:

vim README.md

Basic Vim survival:


6) Installing Software with Package Managers

Installing tools “the right way” matters because it affects updates, dependencies, and security.

6.1 macOS: Homebrew

Install Homebrew (from brew.sh). Then:

brew update
brew install git
brew install python
brew install node

Check installed versions:

git --version
python3 --version
node --version

6.2 Ubuntu/Debian Linux: apt

sudo apt update
sudo apt install -y git curl build-essential

6.3 Fedora Linux: dnf

sudo dnf install -y git curl

6.4 Windows: winget (or Chocolatey)

Using winget:

winget install Git.Git
winget install Python.Python.3

7) Environment Variables and PATH (Why “Command Not Found” Happens)

When you type a command like git, your shell searches directories listed in the PATH environment variable.

View PATH:

echo $PATH

If you install a tool but the command isn’t found, it often means:

7.1 Temporarily Add a Directory to PATH

Example (temporary for current terminal session):

export PATH="$HOME/.local/bin:$PATH"

7.2 Make PATH Changes Permanent

For bash, edit:

For zsh (default on modern macOS), edit:

Add:

export PATH="$HOME/.local/bin:$PATH"

Then reload:

source ~/.zshrc

8) Permissions: Read, Write, Execute (and Why You Get “Permission Denied”)

Unix-like systems (Linux/macOS) control access using permissions.

8.1 Understanding ls -l

Example output:

-rwxr-xr--  1 alex  staff  1200 Mar 10 12:00 script.sh

Breakdown:

So rwxr-xr-- means:

8.2 Make a Script Executable

Create a script:

printf '#!/usr/bin/env bash\necho "Hello from a script"\n' > script.sh

Try running it:

./script.sh

If you get permission denied, add execute permission:

chmod +x script.sh
./script.sh

8.3 Using sudo (Admin Access)

Some actions require admin privileges (installing system packages, changing system files).

sudo apt install -y tree

Be careful: sudo gives commands a lot of power. Prefer installing user-level tools when possible, and don’t run random commands from the internet.


9) Networking Basics: Checking Connectivity and Downloading Files

9.1 Test Connectivity

Ping a host (may be blocked on some networks):

ping -c 4 example.com

9.2 See Your IP (varies by OS)

On Linux:

ip a

On macOS:

ifconfig

9.3 Downloading with curl

Download a page:

curl https://example.com

Download to a file:

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

10) Git Basics: Tracking Changes Like a Professional

Git is version control. It records snapshots of your project over time, making it easy to:

10.1 Configure Git (Do This Once)

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

Check:

git config --global --list

10.2 Create a Repo and Make Your First Commit

Create a folder and initialize Git:

mkdir hello-git
cd hello-git
git init

Create a file:

echo "# Hello Git" > README.md

Check status:

git status

Stage changes (select what will be committed):

git add README.md

Commit:

git commit -m "Add README"

View history:

git log --oneline

10.3 The Three States: Working Tree, Staging Area, Repository

This mental model prevents confusion:

Commands map to these:

10.4 See What Changed

git diff
git diff --staged

10.5 Undoing Common Mistakes

Unstage a file (keep changes):

git restore --staged README.md

Discard local changes (dangerous):

git restore README.md

Amend the last commit message:

git commit --amend -m "Add project README"

10.6 Branches (Lightweight Parallel Work)

Create and switch to a new branch:

git switch -c feature/add-info

Make a change:

echo "Some more info." >> README.md
git add README.md
git commit -m "Add more info"

Switch back to main:

git switch main

Merge the branch:

git merge feature/add-info

11) A Practical Mini-Project (Putting the Basics Together)

You’ll create a small command-line project folder, add a script, and track it with Git.

11.1 Create Project Structure

mkdir -p starter-project/bin starter-project/docs
cd starter-project

11.2 Add Documentation

cat > docs/notes.txt << 'EOF'
This is a starter project.

Goals:
- practice terminal navigation
- practice permissions
- practice git commits
EOF

View it:

less docs/notes.txt

11.3 Add a Script

cat > bin/hello << 'EOF'
#!/usr/bin/env bash
set -euo pipefail

name="${1:-world}"
echo "Hello, $name!"
EOF

Make it executable:

chmod +x bin/hello

Run it:

./bin/hello
./bin/hello Alice

11.4 Initialize Git and Commit

git init
git add .
git commit -m "Initial starter project"

11.5 Add a .gitignore (Common Best Practice)

A .gitignore tells Git what not to track (build outputs, secrets, caches).

cat > .gitignore << 'EOF'
# OS files
.DS_Store

# Logs
*.log

# Environment files (often contain secrets)
.env
EOF

Commit it:

git add .gitignore
git commit -m "Add gitignore"

12) Troubleshooting Patterns (How Beginners Get Unstuck)

12.1 “command not found”

Checklist:

  1. Is it installed?
    git --version
  2. Where is it located?
    which git
  3. Is PATH correct?
    echo $PATH

12.2 “Permission denied”

12.3 “No such file or directory”

Usually means:

Use tab completion to reduce typos:


13) Next Steps (A Good Learning Path)

Once you’re comfortable with the commands and concepts above, a strong next path is:

  1. Learn one scripting language (Python or JavaScript)
    • Practice reading/writing files, parsing text, making HTTP requests.
  2. Learn GitHub basics
    • git remote add origin ...
    • git push -u origin main
    • opening pull requests
  3. Learn debugging habits
    • read error messages carefully
    • reproduce issues
    • isolate variables
  4. Learn how your OS works
    • processes (ps, top)
    • disk usage (df -h, du -sh)
    • services (systemd on Linux)

A few extra commands worth learning soon:

# show disk space
df -h

# show folder sizes
du -sh *

# show running processes
ps aux | head
top

# find files by name
find . -name "*.md"

14) Quick Reference Cheat Sheet

# navigation
pwd
ls -la
cd /path
cd ..
cd ~

# file ops
mkdir -p a/b
touch file.txt
cp file.txt copy.txt
mv copy.txt renamed.txt
rm renamed.txt
rm -rf folder/

# view/search
less file.txt
head -n 20 file.txt
tail -n 50 file.txt
grep -R "text" .

# permissions
chmod +x script.sh
sudo command

# git
git init
git status
git add .
git commit -m "message"
git log --oneline
git switch -c branch
git merge branch

15) Practice Checklist (Do These Without Looking)

Try to complete these tasks from memory:

  1. Create a folder practice, enter it, and create notes.txt.
  2. Write three lines into notes.txt and view it with less.
  3. Search for a word inside it with grep.
  4. Create a script run.sh that prints your name, make it executable, and run it.
  5. Initialize a Git repo, commit everything, create a branch, make a change, and merge it back.

If you can do those five tasks, you’ve built a solid foundation for almost any technical learning track.