Shell Scripting for DevOps

· Linux operating system and basics of shell scripting

· Linux is a popular, free, secure, and fast operating system.

· The kernel is the heart of the operating system, responsible for communication between hardware and software.

· Shell scripting fundamentals

· Learn how to navigate and list files and folders in Linux

· Use CD command to change directories

· Using VI command to create and write contents in a Linux file

· Understand RAM, CPU, and disk management using shell commands

Linux operating system and basics of shell scripting

- An operating system acts as a bridge between software and hardware.

- Operating system drives communication between software and hardware.

Linux is a popular, free, secure, and fast operating system.

- Linux is free and open-source, unlike Windows.

- Linux is very secure and doesn't require antivirus software.

- Linux offers a variety of distributions to choose from.

- Linux is known for its fast performance in production systems.

The kernel is the heart of the operating system, responsible for communication between hardware and software.

- The kernel has four primary responsibilities: device management, memory management, process management, and handling system calls.

- System libraries are responsible for performing tasks and differ slightly between different operating systems.

- Compilers, user processes, and system software are essential components of any operating system.

Shell scripting fundamentals

- Shell is the way to talk to your operating system

- Commands are common across different Linux distributions

Learn how to navigate and list files and folders in Linux

- Use the 'pwd' command to know the present working directory

- Use the 'ls' command to list the files and folders in the current directory

- Use the 'cd' command to change the present working directory

Use CD command to change directories

- Execute PWD command to check present working directory

- Use LS command to list files and folders

- Use LS -LTR command to list files and folders with properties

- Create a file using the touch command

Using VI command to create and write contents in a Linux file

- VI command can be used to create a file and write contents inside the file

- To write content inside a Linux file, open the file, press Esc, then press 'I' to enter insert mode and start writing

- To save the file, press Esc, then type ':wq' and press Enter

- The file can be printed using the 'cat' command

Understand RAM, CPU, and disk management using shell commands

- Use 'free' command to check memory usage

- Use 'nproc' command to check CPU count

- Use 'DF' command to check disk size

- Use 'top' command to monitor all system information

- The main reasons for moving to Cloud are reducing maintenance overhead and being cost-effective.

- Generate a daily report on resource usage

- The concept of a Cron job in Linux allows you to automate script execution at a specific time.

- This script will report the AWS resource usage.

- AWS CLI commands for S3, EC2, and Lambda

- The script provides a list of EC2 instances and IAM users.

- You can use JQ to parse Json and get specific information.

- Integrating a script with cron tab and redirecting output to a file for better user experience.

Launch your GraphyLaunch your Graphy
100K+ creators trust Graphy to teach online
𝕏
Tech Guides 2024 Privacy policy Terms of use Contact us Refund policy