Linux: The Thing Every Dev Should Know - Part 03

April 4, 2026

Process & Threads

Processes

A process is an independent program in execution.

  • Has its own memory space
  • Runs separately from other processes
  • Example: Opening Chrome creates a new process

Threads

A thread is a smaller unit of execution inside a process.

  • Shares memory with other threads in the same process
  • Lightweight and faster to create
  • Example: Multiple tabs running inside one app process

Key Differences

  • Memory
    • Process → Separate memory
    • Thread → Shared memory
  • Communication
    • Process → Slower (IPC needed)
    • Thread → Faster (shared data)
  • Overhead
    • Process → Heavy
    • Thread → Lightweight
  • Crash Impact
    • Process → Isolated (safer)
    • Thread → Can crash entire process

Real-World Analogy

  1. Process = Building
  2. Threads = People working inside it
  • Different buildings don’t share rooms (process isolation)
  • People inside can easily share resources (threads)

Why It Matters

  • Impacts performance & scalability
  • Crucial for:
    • Backend systems
    • Multithreading
    • Parallel processing
    • High-performance apps

Pro Tip :)

  • Use processes for isolation & safety, threads for speed & efficiency.

echo $PATH

echo is used to display text or variables in the terminal.

Basic Usage

echo "Hello World"

Common uses

  1. Print variables:
echo $HOME
  1. Add text to a file:
echo "Hello" >> file.txt
  1. Debug scripts:
echo "Step 1 completed"

Pro tip :)

  • echo is your simplest debugging tool — fast, direct, and always available.

Bash files - .bash/.bashrc/.bashprofile

Bash or any shell uses config files to set up your shell environment every time it starts.

  • Aliases
  • Environment variables
  • PATH updates
  • Custom scripts

Key Bash files

  1. .bashrc
  • Runs on every interactive shell
  • Best for:
    • Aliases (alias ll="ls -l")
    • Functions
    • Prompt customization
  • Most commonly used file
  1. .bash_profile
  • Runs on login shells (when you log in)
  • Best for:
    • Environment variables
    • Startup programs
  • Often calls .bashrc inside it
  1. .profile
  • More generic version (works beyond bash)
  • Used if .bash_profile is missing

Pro tip :)

Treat your .bashrc like your dev setup script — version it, refine it, own it.

Aliases

An alias is a shortcut for a longer command. It makes your life easy

  • Saves time + reduces typing

Basic Usage

alias ll="ls -l"
  • Now instead of typing ls -l, just type:
ll

Common Examples

  1. Safer delete:
alias rm="rm -i"
  1. Human-readable listing:
alias lh="ls -lh"
  1. Git shortcuts:
alias gs="git status" alias gc="git commit"

Make Them Permanent (if you want to)

Add them to:

  • .bashrc (Bash)
  • .zshrc (Zsh)

Then reload:

source ~/.bashrc

View & Remove Aliases

  1. List all:
alias
  1. Remove:
unalias ll

Pro tip :)

  • Aliases turn your terminal into a personalized toolkit — optimized for how you work.

--

export command

export is used to set environment variables and make them available to child processes.

  • Without export, variables stay local to the current shell.

Basic Usage

export NAME="value"

Why export matters

Used for:

  • API keys
  • Config values
  • System paths
  • App settings

Example -

export NODE_ENV="production"

Without vs With Export

  • Without export:
MY_VAR="hello"

Not visible to child processes

  • With export:
export MY_VAR="hello"

Accessible everywhere (child processes)

Main concept

  • export moves a variable from shell scope → environment scope

Pro tip

  • Environment variables are inherited downward (parent → child)
  • Not upward

pwd (Present working directory)

pwd stands for print working directory — it shows your current location in the filesystem.

Basic Usage

pwd
  • Outputs the full path of your current directory

Output example -

/home/user/projects/my-app

Why it matters

  • Helps you stay oriented in the terminal
  • Essential when navigating deep folder structures
  • Useful in scripts and debugging

Pro tip :)

  • If you're lost in the terminal, pwd is your GPS.

. -> current & . -> parent

  • . -> current directory
  • .. -> parent directory (one level up)

Examples

cd .
  • Stay in the same directory (useful in scripts)
cd ..
  • Move one level up

Pro tip

  • . keeps you grounded, .. moves you upward — master both to navigate effortlessly.

Well, that's it for today guys. I hope you have learnt something valuable.

See you Tomorrow. Feel free to reach out to me in case if you need any help.

GitHub
LinkedIn
X