The Shell is a layer between the Operating System(OS) and the user.🐚 It is a user interface for access to the operating system and it uses either a command-line interface (CLI) or a graphical user interface (GUI). In Linux and MacOS this CLI is called Terminal, in Windows Command Prompt.
You can write scripts for the shell which can be used for various purposes, such as executing a shell command, running multiple commands together or performing task automation.
It's easy to get started with shell scripting, let`s create a “hello world” shell script for Linux:
- Open an editor and write:
#!/bin/bash echo "Hello World"
- Save it with a name of your choice with .sh at the end. (I chose “hello.sh”)
- Open your Terminal at the path where you saved the file.
chmod +x hello.shto make the file executable.
- Execute “./hello.sh”
Thats it! What are you up to today? Anything you want to share about the Shell? Have a nice day!😊
Top comments (4)
One of the first Bash commands I learned was
rm -fr .Not good, but good to know!
It seemed like people everywhere I turned were trying to trick others into using this dangerous command.
I never got caught by this or other commands bc others let me in on the 'secret'. ;))
Hehe good that you didn't fall into the trap! My first command was cd. 😄
Life gets a lot better when you learn to script boring and repetitive things!
Yes I totally agree! 😊 Let's automate things to have time for the interesting things. 👩💻