See discussions, stats, and author profiles for this publication at: https://www.researchgate.
net/publication/393281728
Linux Commands for Beginners
Method · July 2025
DOI: 10.13140/RG.2.2.21059.92963
CITATIONS READS
0 44
1 author:
Abdullah Shah
King Fahd University of Petroleum and Minerals
78 PUBLICATIONS 813 CITATIONS
SEE PROFILE
All content following this page was uploaded by Abdullah Shah on 02 July 2025.
The user has requested enhancement of the downloaded file.
Linux Commands for Beginners
Abdullah Shah
Department of Mathematics, KFUPM, Saudi Arabia.
© July, 2025. All rights reserved.
Introduction
Welcome to the world of Linux! This guide is designed specifically for beginners who are
new to the Linux operating system and want to learn how to interact with it using the
command line. Whether you’re managing a personal server, studying for a certification,
or just curious about how Linux works under the hood, this tutorial will introduce you
to the essential commands and concepts that form the foundation of Linux usage.
Let’s get started on your journey to becoming proficient in Linux!
1. Navigating the Linux Filesystem
The Linux filesystem is organized in a hierarchical structure, starting from the root
directory /. Navigating through this structure is a fundamental skill in working with
Linux effectively.
cd – Change Directory
cd / home / user / Documents
cd ..
pwd – Print Working Directory
pwd
ls – List Directory Contents
ls
ls -a # Show hidden files
ls -l # Show detailed info
ls - laR # Show all files recursively
1
2. File Management – Working with Files and Direc-
tories
cp – Copy Files
cp file1 . txt file2 . txt
cp - rpf mydir / / home / user / backup /
mv – Move or Rename Files
mv oldname . txt newname . txt
rm – Delete Files or Directories
rm file . txt
rm - rf folder /
ln – Create Symbolic Links
ln -s / path / to / realfile linkname
rm linkname
3. Editing Files – Terminal-Based Text Editors
Text editors are essential for editing configuration files, scripts, and notes directly from
the command line. Linux provides a range of editors, from simple to highly powerful
ones.
pico
Save: Ctrl + O
Exit: Ctrl + X
emacs
Save: Ctrl + X, then Ctrl + S
Exit: Ctrl + X, then Ctrl + C
vim
vim filename . txt
2
Edit mode: ESC, then i
Save: ESC, then :w
Quit: ESC, then :q
Save and Quit: ESC, then :wq
4. Monitoring Your System
top
Press M for memory, P for CPU, q to quit.
tail
tail -f / var / log / syslog
w
w
5. Shutting Down and Rebooting the System
Always shut down or reboot your system properly using the following commands to avoid
file system corruption or data loss.
shutdown -h now
reboot
shutdown -r now
6. Additional Useful Commands and Tips
Here are more handy Linux command-line tools and techniques that are invaluable for
effective system management and scripting.
Get Help
man ls
info ls
apropos text
Disk Space
df -h
3
File Integrity Check
md5sum filename
Searching
find / - name filename
grep " text " / path / to / search -i
Pipes and Redirection
ls | less
ls > listing . txt
Package Management (RPM)
rpm -i package . rpm
rpm -U package . rpm
rpm - qa | grep name
Scripts and Jobs
^D
^C
^Z
jobs
fg %1
bg %1
Command Recall
! string
!? string
Edit Login Message
sudo nano / etc / motd
4
7. Installing Software
Using apt (Debian/Ubuntu)
sudo apt update
sudo apt install packagename
Using yum (Red Hat/CentOS)
sudo yum install packagename
Using dnf (Fedora)
sudo dnf install packagename
Using pacman (Arch Linux)
sudo pacman -S packagename
8. Running Code
Running Python Code
python3 script . py
Running C Code
gcc program . c -o program
./ program
Running Java Code
javac MyClass . java
java MyClass
Running Shell Scripts
chmod + x script . sh
./ script . sh
5
Summary
This tutorial introduced you to the fundamental Linux commands that every beginner
should know. You learned how to navigate the file system, manage files and directories,
edit text using various editors, monitor system activity, properly shut down and reboot
your system, install packages, and execute different types of code. Mastering these basic
commands is essential to becoming comfortable with Linux. As you continue to use the
command line, you’ll find that these skills form the core of more advanced operations and
scripts.
Happy learning!
9. Recommended Books
Learning the vi and Vim Editors by Arnold Robbins, Elbert Hannah, O’Reilly, 8th
Edition, 2021.
Learning GNU Emacs by Debra Cameron, James Elliott, and Marc Loy. O’Reilly
Media, 3rd Edition, 2005.
Unix and Linux System Administration Handbook by Evi Nemeth, Garth Snyder,
Trent R. Hein, Ben Whaley, and Dan Mackin. Addison-Wesley, 5th Edition, 2017.
Comments are welcomed at scholar.cm@gmail.com
View publication stats