In this tip we will see how to easily and quickly create a bash script via the terminal under Ubuntu. In just a single command, you will have an executable script ready for use. You enter the command, type your script code, save your file and you are done.

Getting Started

Open the terminal (Ctrl+Alt+T) and run this command if you prefer to use the gedit text editor:

gedit "filename"; chmod +x "filename"

To use the nano editor, run this command:

nano "filename"; chmod +x "filename"

Replace filename with any name of your choice you want to assign to your executable file. After submitting your bash script code, save your file and close. The executable file will be created in the current terminal location.

That's it!

Post a Comment