Enabling the execution of Bash script files is a necessary step for running your Bash programs effectively as they aren’t executable by default. In this article, I will show you how you can make your Bash scripts executable using your system’s both Command Line Interface (CLI) & Graphical User Interface (GUI).
What Does it mean to “Make a File Executable” in Bash?
In Bash, making a file executable refers to granting the file the necessary permissions to be executed as a program. By default, when you create a file in Bash, it does not have the executable permission set. However, if you want to run that file as a script or program, you must make it executable.
Why I’ll Make File Executable?
If you don’t make your file executable, you won’t be able to run it directly as a program in Bash. Attempting to execute a non-executable file will result in a “permission denied” error. Check out the following image, where I tried to run a non-executable script: