This content originally appeared on DEV Community and was authored by Babs
LearnBashScriptingWithMe 🚀
Day 1 – Introduction, Shebang & File Permissions
Bash scripting is the process of creating a file that contains a sequence of commands and then running that file as a script.
A shell in Kali Linux is a command-line interpreter that provides an interface for the user to interact with the operating system. It allows users to execute commands, scripts, and programs to manage the system, navigate the file system, and perform various administrative tasks.
👉 We start by creating a file using the “sh” extension as this is used to denote that we are creating a shell script, e.g test.sh
👉 After that the next thing we need to do is to define the kind of interpreter we are going to be using and for this, the interpreter is BASH and we denote that using
#!/bin/bash
👉 Inside the script, we can use the echo command to display output. For example, printing “Hello World!”
echo "Hello World!"
👉 Now we can now save and run the script by using the command “./(filename)”
e.g:
./test.sh
Note that the command "./" is telling the shell to use the interpreter defined in the file we want to run which was what was defined first when we wrote "#!/bin/bash" in the file
But notice—you might get a “permission denied” error. That’s because the file isn’t yet executable.
👉 To fix this, grant execution permission with:
chmod +x test.sh
Now, when you run ./test.sh, the script executes successfully 🎉
Bash #scripting
This content originally appeared on DEV Community and was authored by Babs
Babs | Sciencx (2025-09-02T21:59:36+00:00) Learn Bash Scripting With Me 🚀 – Day 1. Retrieved from https://www.scien.cx/2025/09/02/learn-bash-scripting-with-me-%f0%9f%9a%80-day-1/
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.


