Skip to content

Tutorial 02

Lee Burton edited this page Jul 13, 2025 · 4 revisions

🧭 Navigating with Linux

🖥️ What is the Shell?

The shell is a program that takes commands from your keyboard and gives them to the operating system to perform. In the early days of computing, it was the only way to interact with Linux systems.

Today, while most systems offer graphical user interfaces (GUIs), Linux still relies heavily on the command line interface (CLI) — especially for programming, automation, and science.

On most Linux systems, the shell program is called Bash, which stands for Bourne Again SHell 🐚. It’s an improved version of the original Unix shell (sh), and it’s the most common shell used today.

⚠️ Pro tip: If you run a command by mistake or it’s taking too long, press Ctrl + C to cancel it. This works in most terminal environments.


🛠️ Important Commands

Commands are typed into the terminal and executed by pressing Enter.
In these tutorials, we’ll use a $ symbol to indicate a command you should type — but don’t include the $ when you copy-paste!

💡 If you installed Ubuntu from Tutorial 1, your prompt will look like:

$ 

📍 pwd – Print Working Directory

Shows your current location in the filesystem.

$ pwd  
/User/home/

📂 ls – List

Lists all files and folders in the current directory.

$ ls  
FolderA/ FolderB/ FolderC/ DocumentA

🗂️ mkdir – Make Directory

Creates a new folder.

$ mkdir EXAMPLE  
$ ls
EXAMPLE/

🔄 cd – Change Directory

Changes your current working directory.

$ pwd  
/User/home/  
$ cd /User/home/EXAMPLE  
$ pwd
/User/home/EXAMPLE  
$ cd ../ 
$ pwd
/User/home/   

📌 Common cd shortcuts:

  • .. = go up one directory
  • - = go back to previous directory
  • ~ = go to home directory
  • / = root directory

🗑️ rm – Remove

Deletes files and directories.

  • Remove a file:
$ rm filename
  • Remove a folder and everything in it:
$ rm -r directoryname

⚠️ Be careful — there's no undo!


📋 cp – Copy

Copies files or directories.

  • Copy a file:
$ cp filename targetdirectory
  • Copy a directory and its contents:
$ cp -r directory targetdirectory

🚚 mv – Move / Rename

Moves or renames files and directories.

  • Move a file or folder:
$ mv filenameOrDirectory targetdirectory
  • Rename a file:
$ mv filename newfilename
  • Rename a directory:
$ mv directoryname newdirectoryname

🔎 Useful Command: find

Searches your system for files or folders.

Syntax:

find [where_to_start] [options] [what_to_find]

Example — to search for the EXAMPLE folder starting from the current directory:

$ find . -name "EXAMPLE"

📌 . means "start searching in the current directory".


🎉 Congratulations!

You’ve now learned the basic commands used to navigate a computer using Bash! 🐧
This skill forms the foundation for scripting, automation, and working with remote servers.

➡️ Move on to Tutorial 3 to keep learning!

Clone this wiki locally