Linux Basics

Linux Basics

Day 2 : Linux architecture and basic commands to start with

Linux is a free and open-source operating system based on the Unix operating system. It was initially developed in 1991 by Linus Torvalds as a personal project and has since grown to become one of the most widely used operating systems in the world.

One of the key features of Linux is its open-source nature, which means that the source code is freely available and can be modified and distributed by anyone. This has led to the development of numerous distributions or "distros" of Linux, each with its own set of features and characteristics.

Linux is known for its stability, security, and flexibility. It is used in a variety of applications, including servers, desktops, laptops, mobile devices, and embedded systems. Linux is also highly customizable, allowing users to tailor the operating system to their specific needs and preferences.

Some of the key benefits of using Linux include:

  • It is free and open-source, which means it is accessible to anyone and can be modified to suit their needs.

  • It is highly customizable, with many different distributions and configuration options available.

  • It is known for its stability and reliability, making it a popular choice for servers and other mission-critical applications.

  • It is highly secure, with built-in security features and a strong focus on protecting user privacy and data.

Overall, Linux is a powerful and versatile operating system that is used in a wide range of applications and industries. Its open-source nature, flexibility, and strong community support have helped to make it a popular choice among users and developers alike.

Flavors of Linux

Linux is a popular open-source operating system that is widely used for a variety of applications. It is known for its stability, security, and flexibility, and is used in many different types of devices, from servers and supercomputers to desktops and smartphones. In this blog, we will provide a basic introduction to Linux, its features, and its benefits.

Overall, Linux is a powerful and flexible operating system that can be used for a wide range of applications. Its modularity, command-line interface, and security features make it an ideal choice for many different types of devices and applications. Whether you are a seasoned Linux user or just getting started, Linux has a lot to offer.

There are many flavors of Linux

  1. Ubuntu: Ubuntu is one of the most widely used Linux distributions and is known for its ease of use and strong community support. It comes with a user-friendly interface and is a popular choice for desktop and laptop computers.

  2. Fedora: Fedora is a Linux distribution that is sponsored by Red Hat and is known for its cutting-edge features and a strong focus on open-source software. It is a popular choice for developers and enthusiasts.

  3. CentOS: CentOS is a Linux distribution that is based on the source code of Red Hat Enterprise Linux. It is a popular choice for servers and is known for its stability and security.

  4. Linux Mint: Linux Mint is a popular Linux distribution that is known for its user-friendly interface and focus on multimedia. It is a popular choice for desktop computers and laptops.

  5. openSUSE: openSUSE is a Linux distribution that is known for its ease of use and strong community support. It comes with a user-friendly interface and is a popular choice for desktop and laptop computers.

These are just a few of the many Linux distributions available. Each distribution has its unique features and strengths, so it is important to research and choose the one that best fits your needs and preferences.

Linux Architecture

A Shell provides you with an interface to the Unix system. It gathers input from you and executes programs based on that input. When a program finishes executing, it displays that program's output.

Shell is an environment in which we can run our commands, programs, and shell scripts. There are different flavors of a shell, just as there are different flavors of operating systems. Each flavor of the shell has its own set of recognized commands and functions.

Shell Types

In Unix, there are two major types of shells −

  • Bourne shell − If you are using a Bourne-type shell, the $ character is the default prompt. If you are a root or super user then the # character is the default prompt.

  • C shell − If you are using a C-type shell, the % character is the default prompt.

The Bourne Shell has the following subcategories −

  • Bourne shell (sh)

  • Korn shell (ksh)

  • Bourne Again shell (bash)

  • POSIX shell (sh)

Basic Commands

Check your present working directory.

ls --> The ls command is used to list files or directories in Linux and other Unix-based operating systems

ls -l--> Type the ls -l command to list the contents of the directory in a table format with columns including.

List all the files or directories including hidden files.

ls -a --> Type the ls -a command to list files or directories including hidden files or directories. In Linux, anything that begins with a . is considered a hidden file

ls -I --> List the files and directories with index numbers in orders

ls -d */ --> Type the ls -d */ command to list only directories.

pwd --> Print work directory. Gives the present working directory

cd <path_to_directory> --> Change the directory to the provided path

cd ~ or just cd --> Change the directory to the home directory

cd - --> Go to the last working directory

cd .. --> Change directory to one step back

cd ../.. --> Use ls ../.. for contents two levels above

mkdir directoryName --> Use to make a directory in a specific location

mkdir .NewFolder --> Make a hidden directory (also . before a file to make it hidden)

mkdir /home/user/Mydirectory --> Make a new folder in a specific location

mkdir -p A/B/C/D --> Make a nested directory

Stay tuned for such blogs !!

Thank you for reading.