Skip to main content

Command Palette

Search for a command to run...

Shell Scripting

Published
•2 min read•View as Markdown
Shell Scripting

What is Shell, How does that work ?

Shell is a user interface that allows users to communicate with operating system using commands. In Linux shell is a black and white screen which is also called as terminal where you can enter the command and display the output.

User → Shell → Kernel → Hardware → Kernel → Shell → User.

What is Kernel, what is it responsible for ?

Kernel is a core of the operating system it can directly communicate with hardware and manage the resources:

  • CPU

  • Memory

  • Disk

  • Processes

  • Devices

Let us Compare this with our daily Scenario:

What is Shell Scripting ?

Shell Scripting is running multiple commands simultaneously one after other by keeping them in a single file. It is mostly useful when you have the repeated tasks or when you have lot of commands to run one after other. shell scripting can automate the tasks.

Shell Scripts: Teaching your car to drive itself.

🚗 Now Let’s Switch to Car Mode

Imagine you’re going on a long highway trip.

Normally you would:

  • press accelerator constantly

  • maintain speed manually

  • keep adjusting

That’s a lot of work.

So what do you do?

You turn on…

👉 Cruise Control

Now the car:

  • keeps the speed

  • handles throttle automatically

  • follows the instructions you set

You just relax and monitor.