Guide
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.
Step 1
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
Step 2
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.
Step 3
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.
Step 4
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:~$
Step 5
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.
Step 6
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
Step 7
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.
Step 8
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.
Step 9
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
Step 10
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.
Summary
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 It Matters
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.