Introduction to Linux
What is Linux?
Linux is an Open Source Operating System based on the Linux Kernel. Today, almost 90% of the fastest supercomputers run on Linux variants due to it's various advantages. It allows Multi-user and Multi-tasking with powerful shell. It has multiple flavours like Ubuntu, RedHat, SUSE Linux, Debian, etc. Also, it has high security due to which no anti-virus is required unlike Windows Operating System.
Architecture of Linux
Applications - It can be thought of as the "face" or the "user-friendly" part of the operating system. It's the layer where all the programs and software applications run and interact with users.
Shell: The shell layer acts as a bridge between the user and the lower layers of the operating system. When the user type a command, the shell interprets it and communicates with the kernel (the core of the operating system) to execute the requested action. It interacts with the kernel to manage processes, handle file operations, allocate system resources, and more.
The most common shell is called the "Bash" shell which comes by default with the computer.
Kernel: It can be thought of as the "core" or the "brain" of the operating system. It's that part of Linux that manages and controls all the resources and interactions between the hardware and software on your computer.
Hardware: The Hardware layer consists of the physical devices that Linux supports, such as keyboards, mice, monitors, and network cards.
Basic Linux Commands
Here are the basic Linux commands required to start learning Linux -
Commands | Definition |
ls | List the files and directories in the current directory. |
ls -a | List all the files or directories including hidden files. |
cd | Change the current directory. For example, "cd ubuntu" will move you into the "ubuntu" directory. |
pwd | Print the working directory, which shows you the path of the current directory. |
mkdir | Create a new directory. For instance, "mkdir abc" will create a directory named "abc" |
touch | Create an empty file. For example, "touch text1.txt" will create a file named "text1.txt" |
rm | Remove files or directories. Use with caution, as it permanently deletes files and directories. For example, "rm text1.txt" will delete the "text1.txt" file. |
cp | Copy files or directories. For instance, "cp text1.txt /path/to/destination" will copy "file.txt" to the specified destination. |
mv | Move or rename files or directories. For example, "mv text1.txt new_location/" will move the file to the "new_location" directory. |
cat | Display the contents of a file on the terminal. For instance, "cat text1.txt" will show the content of "text1.txt." |
echo | Print text to the terminal. For example, echo "Hello, Linux!" will display "Hello, Linux!" on the screen. |
grep | Search for a specific pattern in a file. For instance, grep "keyword" text1.txt will find lines containing the "keyword" in "file.txt." |
man | Access the manual pages for commands. For example, "man ls" will show the manual for the ls command. |
sudo | Execute a command with superuser (administrator) privileges. Be careful when using "sudo" as it allows you to make changes that can affect the system. |
mkdir -p | Create a nested directory A/B/C/D/E. For instance, "mkdir -p A/B/C/D/E" creates a nested directory A/B/C/D/E. |
Happy Learning!
~Shilpi