Linux basics
Introduction
This tutorial will guide you through essential Linux command line operations including directory navigation, file management, permissions, and basic bash scripting. Complete each section in order, as later sections build upon earlier concepts.
Prerequisites
- Access to a Linux terminal (Ubuntu, CentOS, or similar distribution)
- Basic understanding of what a command line interface is
Section 1: Directory Navigation and Management
1.1 Understanding Your Current Location
First, let's see where you are in the file system:
pwd
This command shows your Present Working Directory.
1.2 Listing Directory Contents
View what's in your current directory:
ls # List the contents of the current directory
ls -l # Long format with details
ls -la # Include hidden files
1.3 Creating Your Tutorial Directory
Starting location: Your home directory
Create the main tutorial directory:
mkdir linux_tutorial
Navigate into it:
cd linux_tutorial
Current location: You should now be in ~/linux_tutorial
Verify you're in the right place:
pwd
Create subdirectories inside linux_tutorial:
mkdir scripts files documents backup
Create nested directories:
mkdir -p projects/web/frontend
1.4 Navigating Within Your Tutorial Directory
Current location: ~/linux_tutorial
List what you've created:
ls
Navigate to subdirectories:
cd scripts
pwd # Should show ~/linux_tutorial/scripts
cd .. # Go back to linux_tutorial
pwd # Should show ~/linux_tutorial
Navigate to nested directories:
cd projects/web/frontend
pwd # Should show ~/linux_tutorial/projects/web/frontend
cd ../../.. # Go back to linux_tutorial root
pwd # Should show ~/linux_tutorial