Skip to main content

Command Palette

Search for a command to run...

Day 4: Basic Linux Shell Scripting (Part-1)

DevOps Learning

Updated
2 min readView as Markdown
Day 4: Basic Linux Shell Scripting (Part-1)

Before learning Shell Scripting, Let's break it down a bit.

Imagine your computer as a magical box, and the shell is like the wizard who translates your wishes into spells that the box understands. 🧙‍♂️

  1. What is a Shell?

    • A shell is a special program that lets you talk to your computer using commands.

    • It’s like having a secret language to tell your computer what to do.

    • You type in commands, and the shell makes things happen!

  2. Types of Shells:

    • Command-Line Interface (CLI): Think of this as texting your computer. You type commands, and it responds.

    • Graphical User Interface (GUI): Colorful buttons and icons. To interact with your computer you use them.

  3. Why Is It Cool?

    • Automation: Shells help you do things faster. Like a magical recipe book for your computer!

    • System Management: Admins use shells to organize and control their Computer systems.

Bash scripting in different realms:

  1. DevOps:

    • Continuous Integration (CI): Bash scripts help automate building, testing, and deploying code. Imagine a spell that runs every time you update your code!

    • Infrastructure as Code (IaC): Bash scripts create and manage cloud resources. It’s like conjuring servers and databases with a wave of your keyboard.

  2. Automation:

    • Repetitive Tasks: Bash scripts handle mundane chores. Think of them as enchanted brooms sweeping away manual work.

    • Scheduled Jobs: Set up scripts to run at specific times—like clockwork!

  3. System Administration:

    • Configuration Management: Bash scripts configure servers, install software, and tweak settings.

    • Troubleshooting: When things go haywire, Bash helps diagnose issues. It’s like a magical magnifying glass for errors.

Bash/Linux Commands.

  • Bash is a shell that interprets your commands.

  • When you type in commands (like ls, cd, or echo), Bash understands and executes them.

  • Bash is like the translator between you and the computer.

  • Linux commands are the instructions you give to the computer directly.

    • Examples: ls (list files), mkdir (create a directory), grep (search text).
  • Difference:

    • Bash is the interpreter, while Linux commands are the actions.

    • Bash knows how to handle Linux commands, making them work together.

Go through these videos to get hands-on with Bash scripting.

Thank you for reading😉.