Mastering the Linux Terminal✨✍: A Comprehensive Guide to Commands and Concepts

Mastering the Linux Terminal✨✍: A Comprehensive Guide to Commands and Concepts

Unix🤔- Linux🤔- Shell 🤔- Bash🤔 - Terminal - 🤔Command Prompt🤔, etc.

Are you also confused?👇

In the world of computer science and technology, many terms and concepts can be confusing or difficult to understand, such as Unix, Linux, Shell, Bash, Terminal, and Command Prompt.

So, In this article, we will break down these concepts and explain what they mean in simple language.

We will explore what a shell is and how it works, introduce the Bash shell, and explain how a terminal and command prompt can be used to interact with a computer system.

By the end of this article, you will have a clear understanding of these important concepts and other Linux commands.

Some Important Terms to Understand👇

  • Unix👇

Unix is an operating system developed in the 1970s, which provides a command-line interface to interact with the system.

To check this:-

  • Linux👇

Linux is a Unix-like operating system that was developed in the 1990s, based on the Unix architecture.

To check this:-

  • Shell - An important topic👇

A shell is a program that runs in the terminal and interprets the user's commands. It acts as an interface between the user and the operating system.

For example, when you enter mkdir student as a command and execute them accordingly.

# To create new directory
mkdir student

The shell program does this by looking for executable files with the same name as the command.

For instance, the shell searches for an executable file called mkdir in the directories listed in the system's PATH environment variable. When it finds the file, it loads it into memory and executes it.

See how to get the path

In this way, the shell acts as an intermediary between the user and the computer's operating system. It allows users to interact with the system using textual commands, without needing to use a graphical user interface.

  • Bash👇

Bash is a popular shell that is widely used on Linux and other Unix-like systems.

  • Terminal Emulator👇

A terminal is a program that provides a text-based interface to interact with the system. It allows users to enter commands and receive text-based output. A terminal can be opened on a graphical desktop environment, such as GNOME or KDE, or accessed remotely through SSH.

Ex:- PowerShell, cmd, and Git Bash are all examples of terminal emulators.

  • Command Prompt👇

A command prompt is a text-based interface that allows users to enter commands and receive text-based output. It is typically displayed in a terminal window and shows the user's current working directory and a prompt character, such as $ or #.

Basic Linux Commands👇

1. pwd 🚀

This command stands for "print working directory". It displays the name of the current working directory (i.e., the directory that you are currently in). For example, if you type pwd in the terminal, it might display something like:-

2. who 🚀

This command displays information about the users who are currently logged in to the system. It can show the username, terminal device, and login time for each user.

3. mkdir 🚀

This command stands for "make directory". It is used to create a new directory in the current working directory. For example, if you type mkdir random in the terminal, it will create a new directory called "random" in the current working directory.

4.rmdir 🚀

This command stands for "remove directory". It is used to delete an empty directory from the file system. For example, if you type rmdir random in the terminal, it will delete the "random" directory if it is empty.

  • If the directory contains some files or folders then we have to use -r tag.

5.cd 🚀

This command stands for "change directory". It is used to change the current working directory to another directory. For example, if you type cd random in the terminal, it will change the current working directory to the "random" directory.

  • If we want to go back to the previous directory then use cd .. command

6.ls 🚀

This command stands for "list directory". It is used to display the contents of a directory. For example, if you type ls in the terminal, it will display a list of all the files and directories in the current working directory.

  • Here, The -a flag represents the display of all files (including hidden files).

  • -R Is the recursive tag that displays all the files which are inside the current directory and its sub-directories.

7. touch 🚀

This command is used to create a new file in the current working directory. For example, if you type touch my_file.txt in the terminal, it will create a new file called "my_file.txt" in the current working directory.

There are 3 ways you can create a file:-🔥

  • 1). Using cat command:-🔥

  • 2). Using vim editor:-🔥

Now, Add some content and press esc key + w key + q key. So w for write and q for quit (means save and exit).

  • Now print that file

  • 3). Using the touch command which we had already covered.🔥

8. rm 🚀

This command stands for "remove". It is used to delete a file or directory from the file system. For example, if you type rm my_file.txt in the terminal, it will delete the "my_file.txt" file from the current working directory.

  • If you want to delete a directory and its contents, you can use the -r option, as in rm -r my_folder. Be careful when using the rm command, as it permanently deletes files and directories and they cannot be recovered once they are deleted.

--.--.------------------------- To be Continued --------------------------.--.--

💫Note:- 😎

Thank you for reading this blog post. I hope you found it informative and useful. Stay tuned for more commands here only, we will delve further into the types of commands. See you next time!🚴‍♀️

Thanks for scrolling.🏃‍♀️

— Mohammed Rizwan Bhavnagri, May 1, 2023.

Did you find this article valuable?

Support Interview Preparation Articles by becoming a sponsor. Any amount is appreciated!