DevOps – Linux Foundation
The most important term in the world of DevOps.
first, let’s understand the term Linux and why it is so important.
Definition: Linux is an operating system, like Windows or macOS, but it’s different in a few key ways. An operating system is the software that manages all the hardware on your computer and lets you run other programs. Linux is an open- source. The Linux kernel is the core part of the operating system, managing hardware resources and enabling communication between software and hardware.
Note: Linux is a powerful, flexible, and secure operating system that you can use on your computer. It’s popular among tech enthusiasts, developers, and organizations that need a stable and secure environment.
Â
Why Linux
Open Source: Linux is free to use, modify, and distribute. This fosters innovation and community collaboration, making it highly customizable.
Stability and Reliability: Linux is known for its stability, with many servers running for years without rebooting. It’s popular for web servers, databases, and other critical systems.
Security: Linux is considered more secure than many other operating systems due to its design and the open-source community’s constant scrutiny and updates.
Performance: Linux can run efficiently on various hardware, from powerful servers to older, less powerful machines. It’s often used in high-performance computing environments.
Now we know what is Linux and why it is so important in the world of DevOps.
let’s understand some Linux basics, that we should know about it.
Linux CLI(Command Line Interface): The Linux CLI is a text-based interface where you type commands to interact with the operating system. Unlike using a graphical interface where you click on icons and menus, the CLI allows you to directly type commands to perform tasks like navigating files, managing processes, or installing software. It might seem intimidating at first, but it’s incredibly powerful and efficient once you get the hang of it. Common commands include ls (to list files), cd (to change directories), and cp (to copy files).
VI Editor: The VI editor is a text editor in Linux that’s been around for a long time and is highly popular among system administrators and developers. It operates entirely in the command line, which makes it fast and available on almost every Linux system.
VI has two main modes:
Insert mode: where you can type and edit text.
Command mode: where you can navigate, delete, or manipulate text.
Switching between these modes is key to using VI effectively. For example, pressing I will put you in insert mode, and pressing Esc will bring you back to command mode.
Service Management:
Service management in Linux involves starting, stopping, and managing background processes or “services” that run on your system. These might be things like a web server, a database, or a scheduled task. The tool most commonly used for this is systemd, which is a system and service manager.
You can start a service with sudo systemctl start <service-name>.
Stop it with sudo systemctl stop <service-name>.
Enable it to start on boot with sudo systemctl enable <service-name>
we have a two most widely used distributed system in IT industry.
RPM based
Debian based
Shell in Linux
What is the Shell in Linux?
The shell in Linux is a program that acts as an interface between the user and the operating system. It takes the commands you type, interprets them, and tells the OS what to do. In other words, the shell is your gateway to interacting with the system via text commands, rather than through graphical elements like buttons and icons.
When you open a terminal window in Linux, you’re interacting with the shell. The shell interprets the commands you type and executes them, displaying the results in the terminal.
How to Use the Shell in Linux?
Using the shell in Linux involves typing commands at the command prompt and then pressing Enter. Here’s a basic example:
Open the Terminal: This is where you access the shell. The terminal is usually an app you can find in the applications menu.
Type a Command: For example, type ls to list the files and directories in your current location.
Press Enter: The shell processes your command and displays the output.
You can perform a wide variety of tasks in the shell, such as navigating the file system (cd command), copying files (cp command), and even running scripts or compiling code.
Types of Shells in Linux
There are several different types of shells available in Linux, each with its own features and syntax. Here are some of the most common ones:
Bash (Bourne Again Shell)
Most Common: Bash is the default shell on many Linux distributions. It’s powerful, with many features like command history, tab completion, and scripting capabilities.
File: /bin/bash
Zsh (Z Shell):
Feature-Rich: Zsh includes everything from Bash and adds more advanced features like spell correction, better auto-completion, and themes. It’s popular among power users.
File: /bin/zsh
Sh (Bourne Shell):Original Unix Shell: Sh is the original shell for Unix systems. It’s simpler and more lightweight than Bash, but less feature-rich. Some scripts are still written in sh for compatibility reasons.
File: /bin/sh
Csh (C Shell):C-Like Syntax: Csh uses a syntax similar to the C programming language, which can be useful for users familiar with C. It’s less common today but still in use.
File: /bin/csh
Ksh (Korn Shell):Combination of Features: Ksh was developed to combine features from the Bourne shell and C shell, adding more programming features and improved scripting.
File: /bin/ksh
Fish (Friendly Interactive Shell):User-Friendly: Fish is known for its user-friendly features like syntax highlighting, autosuggestions, and a web-based configuration interface.
File: /usr/bin/fish
Switching Between Shells
You can switch between different shells by simply typing the shell’s name in the terminal. For example, if you’re in Bash and want to switch to Zsh, just type zsh and press Enter. To go back to Bash, type bash and press Enter.
The shell is a crucial part of the Linux experience, offering powerful tools for interacting with the system, automating tasks, and much more.
Search
Categories
Latest Posts
DevOps : CI/CD
September 6, 2024DevOps – Virtualization
September 4, 2024DevOps – Git and Github Basics
September 4, 2024Popular Tags