Shell Scripting Practice Exercises with Demonstration
|
Learn the basics of shell scripting on a Linux operating system with this comprehensive course. Automate tasks, create simple programs, and understand different shell environments. Ideal for system administrators, data scientists, web developers, and DevOps professionals. Topics covered include installation, file manipulation, text processing, conditional statements, loops, functions, real-life scripting examples, and more. Enhance your skills and efficiency with shell scripting.
What you’ll learn
- Students will be able to understand the basic concepts of shell scripting, including how to write and execute the scripts.
- Students will be able to change files and directories, process text, and do basic system tasks by using common shell commands.
- Student will be able to use shell scripts to talk to other programs and services, like web servers and databases.
- Student will be able to understand the differences between different shell environments and how to choose the appropriate shell for a given task.
This course will be beneficial for anyone who is interested in automating tasks or creating simple programs on a Linux operating system. Some examples of people who might benefit from learning shell scripting include: System administrators will be able to automate system maintenance tasks, such as backups and server updates. Data scientists will be able to learn about pre-process and organize data sets, or to automate data analysis pipelines. Web developers will be able to use to automate the deployment of web applications or to set up a local development environment. DevOps professionals will be able to use to automate the build, test, and deployment processes of software projects.
In this course we will cover the following:
Section 1: Course Overview
Course Overview
Section 2: Lab Setup
Installation of Virtual Box
Download & Installation of Linux(CentOS) on VirtualBox Step by Step
Download, Install and connect through putty
Section 3: Shell Scripting Standards
The Shell
What is Shell Scripting?
Naming Convention for Shell Script
Shell Scripting Format
File Permissions in Linux
How to Run a Shell Script
Basic Commands used in Shell Scripting
Listing files and understanding LS output
Text Editor vi Introduction
Quiz
Section 4: Shell Scripting Basic Concepts
Creating first script – Hello World
Defining variable
Arithmetic Expressions in Shell Scripting
String Manipulation in Shell Scripting
String Comparisons in Shell Scripting
Read and Echo (Input/Output) statements
Relational Operators in Shell Scripting
Conditional Statements (Decision Making)
Case Statement
For loop in Shell Scripting
Do-while in Shell Scripting
Until Loop in Shell Scripting
Select Loop in Shell Scripting
Infinite Loops, and Sleeping
Exit Status in Shell Scripting
Special Variables in Shell Scripting
Quiz
Section 5: Working with Functions, Arrays and String
Functions in Shell Scripting
Passing Parameters to a Function
Nested Functions
Indexed array in Shell Scripting
Associative array in shell Scripting
String Concatenation
Extract a substring from a string
Nested Loop in Shell Scripting
Nested Conditions in Shell Scripting
Shifting in Shell Scripting
Quiz
Section 6: Real Life Scripting
Searching and Extracting Data from Files
Shell script to delete oldest files and folders
Shell Script to Backup Files in Directory
How to use Loops in a file system?
Check Users Logged In, Ordered by Date, or IP Address
How to trace log messages in a shell script?
How to automate user account creation?
How to check users not logged in?
How to track the process’s status and terminate it?
How to add and delete data from Inventory?
How to reuse one script information to another?
How to check the status and connectivity of remote hosts?
How to schedule script through cron job?
How to check disk space status?
How to create and verify created files?
How to create script on run time?
Store data on live server database
Get data from live database server
Quiz
Section 7: Additional Content
The Linux Directory Structure
Absolute vs relative path of a directory
Creating files and directories by command line
Changing File Permissions
Modify File Ownership for user and group
Copying Directories and Files
Removing Directories and Files
head and tail commands
Wild Cards
Grep
Pipe
Shell Aliases
Compressing and archiving files (using tar, gzip)
Explanation of Tab Key Completion
Find your IP address in linux
User and group administration by command
Ping command
Handouts
Who this course is for:
- This course will be beneficial for anyone who is interested in automating tasks or creating simple programs on a Linux operating system.