[root@tomskbs ~]# Linux Commands Tutorial

Master the essential commands every Linux user should know

Getting Started with Linux Commands

This tutorial will guide you through fundamental Linux commands. We'll create a folder, create a text document, and copy that document to the desktop - all through the command line!

Commands You'll Learn

  • $
    pwd - Print working directory
  • $
    ls - List directory contents
  • $
    mkdir - Create new directory
  • $
    cd - Change directory
  • $
    nano - Simple text editor
  • $
    cp - Copy files/directories

Hands-on Tutorial

1 Open a terminal window

You can open it by searching "Terminal" in the applications menu, or by pressing Ctrl + Alt + T.

2 Check your current location

pwd
pwd command

This shows you're in your home directory.

Pro Tip: You can return to your home directory from anywhere by typing cd ~

3 List directory contents

ls
ls command

4 Create a new directory

mkdir firstfolder
Note: Linux is case sensitive - firstfolder is different from FirstFolder

5 Navigate into the new directory

cd firstfolder
mkdir and cd command
Pro Tip: Use tab completion! Type cd fir and then press Tab to autocomplete.

6 Create and edit a text file

nano hello.txt
nano text editor

Nano Editor Basics:

  • Ctrl+X Exit
  • Ctrl+O Save
  • Ctrl+G Help
  • Ctrl+W Search

7 Copy the file to your Desktop

cp hello.txt ~/Desktop
hello.txt opened from the desktop
Success! You've successfully created, edited, and copied a file using the Linux command line!
Linux Basics Tutorial
Next Lesson
Next Tutorial