
🐧 What is a Terminal Shell? 🖥️
A terminal shell is a program that understands and executes commands you type.
The Linux terminal shell is a text-based interface that lets you communicate with the system using commands.
It acts as a middleman between you and the operating system, making it easier to interact with the system using text.
🐧How does it work 🤯❓

Prompt
📜 When you open the terminal, you'll see a prompt (usually $ or #) waiting for your command.
$: Represents Normal User
#: Represnts Root User / Super User / Admin
🐚 It means the shell is ready to accept your instructions.
Commands
🖊️ You can type commands after the prompt to perform specific tasks.
🐚 Commands can be simple (like listing files) or complex (like searching for text in files).
🔢 Command parameters or options modify how the command behaves.
Command Execution
▶️ After you press Enter, the shell interprets and executes the command.
🐚 It looks for the command in specific places on the system using the PATH variable.
🚀 When found, it loads the command into memory and runs it.
Output and Error Messages
📤 The command may produce output or error messages, displayed in the terminal.
🐚 Output can be text, data, or even graphical information, depending on the command.
⚠️ Error messages tell you if something went wrong during command execution.
Scripting and Automation
📜 Shell scripting lets you create scripts with multiple commands.
🤖 These scripts automate repetitive tasks, saving time and effort.
🐚 By running a script, you can avoid typing individual commands repeatedly.
🐧 Understanding Using Basic Commands❗
Let's understand it by solving some basic questions:
Part 1:
Check your present working directory
pwd : present/print working directory

List all the files or directories including hidden files
ls -a : list files or directories including hidden files or directories

Create a nested directory A/B/C/D/E
mkdir : used to make directory
mkdir -p A/B/C/D/E : Creates nested directories
-p : parent

Let's level up with some more questions :
To view what's written in a file
cat : read the content of the file

To change the access permissions of files.
chmod : change the access mode of a file
Every file in Linux has one of three permission types: read (r), write (w), or
execue (x).
Three types of users can have these rights set: the file's owner (u), the group to which the file belongs (g), and other users (o), who are neither the owner nor a member of the group.
We employ a combination of letters and symbols to alter the permissions. For instance: -
The file owner is given read, write, and execute permissions using the
command "chmod u+rwx example.txt".
Removing the group's and others' read permissions using
"chmod go-r example.txt"

To check which commands you have run till now.
history : used to view the previously executed command

To remove a directory/ Folder.
rmdir : used to remove/delete directory

To create a fruits.txt file and to view the content.
vim filename : creates a file and views the content for read/modify.
nano can also be used , it works the same.They directly open editors to view and edit the content
we can also use "touch" to create empty files
To read the content of the file we use "cat"

Add content in devops.txt (One in each line) - Apple, Mango, Banana, Cherry, Kiwi, Orange, Guava.
use nano/vim and edit the content


To Show only top three fruits from the file.
head : print the top N number of data of the given input

To Show only bottom three fruits from the file.
tail : prints the last few number of lines of a certain file

To create another file Colors.txt and to view the content.
use nano or vim to create and view the content
we can also use "touch" to create empty files
To read the content of the file we use "cat"

Add content in Colors.txt (One in each line) - Red, Pink, White, Black, Blue, Orange, Purple, Grey.
use nano or vim to edit the content


To find the difference between fruits.txt and Colors.txt file.
diff : compares two files and produces a list of the differences between the two.

Other commands will be explored in Advance Linux . Stay tuned :D
Happy Learning :D
About the author
- Site Reliability Engineer passionate about cloud infrastructure, automation, scalability, and operational excellence. I write about SRE, DevOps, Azure, AWS, Kubernetes, CI/CD, and real-world troubleshooting experiences.
Comments
Join the discussionNo comments yet. Be the first to comment.
DevOps
Welcome to "Mastering DevOps," a thorough and in-depth blog series created to walk you through the DevOps world and its critical function in contemporary software development.



