Linux Terminal Basics

This guide introduces basic Linux terminal commands used for file navigation, file management, basic network checks, and security lab practice.

The examples use a Linux-style terminal prompt:

hawkode@linux:~$

You do not type the full prompt. You only type the command after the $ symbol.

Understand the terminal prompt

A terminal prompt shows that the system is ready for you to type a command.

hawkode@linux:~$

In this example:

  • hawkode is the username
  • linux is the computer name
  • ~ means the home folder
  • $ means the terminal is ready for a command

Check where you are with pwd

The pwd command shows your current folder location. It means print working directory.

hawkode@linux:~$ pwd
/home/hawkode

This is useful before creating, moving, or deleting files because it confirms where you are in the system.

List files and folders with ls

The ls command shows what is inside the current folder.

hawkode@linux:~$ ls
Desktop  Documents  Downloads  Projects

This helps you see what folders or files are available before moving around.

A more detailed version is:

hawkode@linux:~$ ls -l

This shows extra information such as file permissions, owner, size, and date modified.

Move between folders with cd

The cd command means change directory. It lets you move into another folder.

hawkode@linux:~$ cd Documents
hawkode@linux:~/Documents$

The prompt changed from:

~$

to:

~/Documents$

That means you are now inside the Documents folder.

To go back one folder:

hawkode@linux:~/Documents$ cd ..
hawkode@linux:~$

Create a folder with mkdir

The mkdir command creates a new folder.

hawkode@linux:~$ mkdir labs

Now check that the folder was created:

hawkode@linux:~$ ls
Desktop  Documents  Downloads  Projects  labs

This is useful for organising lab files, notes, scripts, and project work.

Create a file with touch

The touch command creates an empty file.

hawkode@linux:~$ touch notes.txt

Check that the file exists:

hawkode@linux:~$ ls
Desktop  Documents  Downloads  Projects  labs  notes.txt

Read a file with cat

The cat command prints the contents of a file in the terminal.

hawkode@linux:~$ cat notes.txt

If the file is empty, nothing will appear. That is normal.

This command is useful for quickly checking small files, notes, logs, and command output.

Copy and move files

Use cp to copy a file.

hawkode@linux:~$ cp notes.txt notes-backup.txt

This creates a second copy called notes-backup.txt.

Use mv to move a file into a folder.

hawkode@linux:~$ mv notes.txt labs/

Now the file has been moved into the labs folder.

Remove files carefully

Use rm to delete a file.

hawkode@linux:~$ rm notes-backup.txt

Be careful: Linux usually does not move deleted files to a recycle bin. Once removed, they can be hard to recover.

Before deleting anything, check your location:

hawkode@linux:~$ pwd

And check what files are in the folder:

hawkode@linux:~$ ls

Basic network checks

The command line is useful for checking network connectivity.

Use ping to test if a system is reachable:

hawkode@linux:~$ ping 8.8.8.8

Use ip address to view network interface and IP information:

hawkode@linux:~$ ip address

These commands are useful when troubleshooting basic connectivity problems.

Commands covered

pwd: show your current location

ls: list files and folders

cd: move between folders

mkdir: create a folder

touch: create an empty file

cat: read a file

cp: copy a file

mv: move or rename a file

rm: delete a file

ping: test network connectivity

ip address: show network interface information

Why this matters in IT and security

The command line is a foundation skill for IT, networking, Linux administration, cybersecurity labs, scripting, log analysis, and troubleshooting.

Once the basics are clear, it becomes easier to work with more advanced tools, follow technical labs, document results, and understand what your system is doing.