Software Development

Linux

Guide to Linux distributions, terminal basics, permissions, processes, and scripting.

Linux Terminal Commands

terminalbasic.bash
man ls  # List manual

ls    # List directory
ls -l # Shows more details
ls -a # Shows hidden 
ls -h # Shows human readable info

cd        # Change directory
cd ..     # Move to parent directory
cd ~      # Move to home
cd <tab>  # View suggested inputs
pwd       # Print working directory full path

tree        # Show all files and folders in the current directory
tree /path  # Show the structure of a specific directory.
tree -L 2   # Limit the depth of displayed subdirectories to 2 levels.
tree -d     # Show only directories
tree -f     # Show the full path 

touch file.txt  # Create file
mkdir dir       # Make directory
rm file.txt     # Remove file
rmdir           # Remove directory
cp test.txt ~/Downloads # Copy file
mv test.txt ~/Downloads # Move file/rename file

cat -n file.txt   # Concatenate and display file content.

which # Locate a command.
which command # Find the path of an executable
which ls # Check if a command is available in the system

history # Show the list of recent commands
history | grep "pattern" # Search for commands containing specific text

alias # Create shortcuts for commands.
alias ll='ls -l' # Create an alias for a command
alias # List all defined aliases

Source: Linux Terminal, FreeCodeCamp

TMUX & Byobu

Terminal Multiplexer (TMUX) enable multiple terminnal session on a single window. On SSH, this enable the terminal to stay alive when the connection lost. Byobu is a wrapper around TMUX that provides a user-friendly interface and sync session across multiple clients. TMUX support themes too.

byobu : Enter

F2 : New Window
F3 : Previous Window
F4 : Next Window
F8 : Change window title
Shift + F2 : Split Vertically (Up/Down)
Ctrl + F2 : Split Horizontally (Left/Right)
Ctrl + F6 : Delete Tab

F7 : Scrollback Mode. Press spacebar to select, and enter to copy.
Shift + Alt + Dir : Resize a split window (pane)


byobu-tmux rename-session -t old-name "new-session-name"
byobu list-sessions
byobu attach -t "my-project"  # Open that sesion
clear && byobu-tmux clear-history

Linux Distributions

Distribution Comparison

FamilyDistributionKey Strengths
DebianUbuntuHigh stability, massive community, ideal for beginners and servers.
Linux MintLightweight, user-friendly interface (Cinnamon).
Kali LinuxSpecialized for penetration testing and digital forensics.
IndependentArch LinuxMinimalist, DIY approach, bleeding-edge rolling release.
Red HatFedoraInnovative features, upstream-first, strong security (SELinux).
CentOS StreamEnterprise-grade foundation, stable, binary compatible with RHEL.

Linux Mechanism

Linux shell

A shell connects user to the system through terminal. Automate tasks using shell scripts. Scripts is a file which tells the shell to execute in order. Linux-based system use .sh for script file, Windows use .ps1 for powershell and .bat or .cmd for command prompt, cross-platform python use .py

ShellDescription
Bash (Bourne Again Shell)Default on many Linux systems.
Zsh (Z Shell)Enhanced with more features and better scripting.
Fish (Friendly Interactive Shell)User-friendly with autosuggestions.
Dash, Ksh, Csh, TcshOther alternatives.

Processes

Foreground Process: Runs in terminal Background Process: Ends when system reboot or user logs out

Package Management

  1. Debian-based (Ubuntu, Debian)
  • apt (Advanced Package Tool)
  • dpkg (Debian Package Manager): Install a .deb file:
  1. RedHat-based (RHEL, CentOS, Fedora)
  • yum (Yellowdog Updater, Modified)
  • dnf (Modern replacement for yum in Fedora)
  • rpm (RedHat Package Manager)
  1. Universal
  • snap (Canonical's universal package format): Slow in ubuntu
  • flatpak (Universal package system for Linux)

File Compression

  1. tar (Tape Archive) - Combines multiple files into one archive without compression. Often used with gzip for compression.
  2. gzip (GNU Zip) - Compresses a single file using the .gz format. Cannot combine multiple files into one (use tar first).
  3. gunzip - Used to extract files compressed with gzip.

Filesystem Knowledge

DirectoryPurpose
/homeStores user files (e.g., /home/user)
/etcSystem-wide configuration files (e.g., /etc/passwd)
/varVariable data like logs (/var/log), cache, and temporary files
/tmpTemporary files (auto-cleared on reboot)
/usrUser-installed programs (/usr/bin, /usr/lib)
/procVirtual filesystem with system/process info (/proc/cpuinfo)

To access an external drive, it must be "mounted" to a directory.

Environment Management

Environment variables are added to ~/.bashrc or ~/.profile

FilePurpose
~/.bashrcUser-specific shell configuration, runs on new interactive shells
~/.profileUser login script, used in login shells
/etc/environmentSystem-wide environment variables

Build Tools

gcc is a compiler for C language and g++ is a compiler for C++ language.

make (Makefile System) is a build automation tool for unix that compiles complex projects efficiently. make only recompiles modified files.

cmake is a cross-platform build system generator.

Users

  1. Root User (sudo, root) – The superuser with full system control.
  2. Regular User – A non-root user with limited permissions.
  3. System Users – Used for system processes (e.g., www-data for web servers).

Install Ubuntu 22.04 on VM Windows

Copyright © 2026 Nut17. All rights reserved.