Linux For Beginner

Linux is a free, open-source operating system based on Unix. It is used as a platform for a wide range of computer systems, from personal computers to servers and supercomputers. It is known for its stability, security and flexibility.

Kernel:

The Linux kernel is the core component of the Linux operating system. It acts as a bridge between the hardware and software components of a computer system. It provides a range of services to the software, including managing system resources, providing a file system and allowing communication between different processes. The Linux kernel is developed as an open-source project and is widely used in a variety of operating systems and devices.

Shell:

A shell is a user interface for accessing an operating system's services. In Linux, the shell is a command-line interface that allows users to interact with the systems by typing commands and receiving text-based outputs. some common shell programs in Linux include Bash (Bourne Again Shell), Zsh (Z shell) and Tcsh (Tenex C Shell ). The shell provides a way to automate tasks, execute programs and manage system resources, and it is an important tool for system administrators and power users.

Shell Scripting:

Shell Script is a file consisting of lists of commands executed sequentially. It helps in automating the day-to-day tasks of DevOps engineers and Linux Admins. For example, if you want to schedule a backup of your file then with the help of a shell script it can be automated to take backups.

Let's look into some first shell script:

  1. Create a file

    vi <filename.sh>

  2. Provide permission to execute scripts

    chmod 777 <filename.sh>

Execute the script

./<filename.sh>

Directory Structure:

  • The /root directory is the home directory for the root users.

  • The /dev directory contains device files.

  • static boot files are located in the /boot directory.

  • Application and user utilities are found in the /usr directory

  • log files of various applications are located in the /var directory.

  • Configuration files are stored in the /etc directory.

  • User folders are located in the /home directory.

  • check all add-on application packages in the /opt directory.

  • The /proc directory is a virtual filesystem that holds information on currently running processes. On shutdown, it destroys.

  • User binary files are located in the /bin directory.

  • The /lib directory stores shared library images and kernel modules.

    Some Commands:

  • ls - lists the files and directories in a directory

  • cd - changes the current working directory

  • pwd - displays the current working directory

  • cp - copies a file or directory

  • mv - moves or renames a file or directory

  • rm - deletes a file or directory

  • mkdir - creates a new directory

  • rmdir - deletes an empty directory

  • echo - displays text to the screen

  • cat - displays the contents of a file

  • nano - a simple text editor

  • chmod - changes the permissions of a file or directory

  • chown - changes the owner of a file or directory

  • ping - tests connectivity to a network host

  • ssh - secure shell remote login protocol.