Skip to main content

Linux Basics Course

Welcome to the Linux Basics course! This course is designed for beginners who want to learn the fundamentals of Linux, the terminal, and command-line tools. By the end of this course, you'll be comfortable navigating Linux, managing files, and using basic shell commands.

Funny PenguinsUbuntu Logo

1. Introduction to Linux

Linux is an open-source operating system widely used for servers, development, and embedded systems. Key features:

  • Open-source and free
  • Stable and secure
  • Multi-user and multitasking
  • Supports a variety of file systems

Objectives

  • Understand Linux architecture
  • Learn basic shell commands
  • Manage files and directories
  • Use text editors and scripts

2. Getting Started with the Terminal

The terminal is the main interface for interacting with Linux.

  • Open a terminal (Ctrl + Alt + T on most distributions)
  • The shell prompt looks like this:
username@hostname:~$
  • Commands follow the structure: command [options] [arguments]

Example:

ls -l /home

3. File and Directory Management

Commands:

  • pwd — Show current directory
  • ls — List files
  • cd — Change directory
  • mkdir — Create a directory
  • rm — Remove files or directories
  • cp — Copy files or directories
  • mv — Move or rename files

Exercise:

  1. Create a directory called linux_course
  2. Inside it, create a file notes.txt
  3. Move the file to a subdirectory week1

4. Viewing and Editing Files

  • cat filename — Display file content
  • less filename — Scroll through content
  • nano filename — Edit files using Nano editor
  • vim filename — Edit files using Vim editor

Exercise:

  1. Open notes.txt with Nano
  2. Add your name and today's date
  3. Save and exit

5. Searching and Finding Files

  • find /path -name "filename" — Search for files
  • grep "pattern" file — Search inside files
  • locate filename — Quickly find files (requires updatedb)

Exercise:

  1. Create a file log.txt with some text
  2. Use grep to find the word "Linux"

6. Process Management

  • ps — List running processes
  • top — Interactive process viewer
  • kill PID — Terminate a process by ID
  • htop — Enhanced process viewer (optional install)

Exercise:

  1. Run a background process: sleep 100 &
  2. Find its PID using ps
  3. Kill the process

7. Permissions and Users

  • ls -l — View file permissions
  • chmod — Change file permissions
  • chown — Change file owner
  • adduser username — Add a new user
  • su username — Switch user

Exercise:

  1. Create a file secret.txt
  2. Change permissions so only you can read/write it

8. Package Management (Debian/Ubuntu)

  • sudo apt update — Update package lists
  • sudo apt upgrade — Upgrade installed packages
  • sudo apt install package_name — Install a package
  • sudo apt remove package_name — Remove a package

Exercise:

  1. Install htop
  2. Launch htop and observe processes

9. Learning Linux with GameShell

GameShell is a fun, interactive way to practice Linux shell commands:

  • It turns Bash into a text adventure game
  • Missions involve navigating directories, managing files, and using commands -Available in multiple languages

Getting Started:

sudo apt install gettext man-db procps psmisc nano tree ncal x11-apps wget
wget https://github.com/phyver/GameShell/releases/download/latest/gameshell.sh
bash gameshell.sh

10. Next Steps

  • Learn Bash scripting: loops, conditionals, functions
  • Explore cron jobs and automation
  • Study networking commands: ping, netstat, ssh, scp
  • Try Linux on a virtual machine or Raspberry Pi for practice

Resources


Summary

  • By completing this course, you should be able to:
  • Navigate and manipulate the Linux filesystem
  • Use essential Linux commands
  • Manage users, permissions, and processes
  • Explore Linux interactively with GameShell