DEV Community

Frank A
Frank A

Posted on

Linux Scripting in 10 Minutes

If you can type a few commands in the terminal, you can write your first Linux Script. Let’s make Linux work for you.

To make a Linux bash script, open your favorite text editor (vim,nano,sublime text whatever). Then write this line on top

#!/bin/bash

From then on, you can simply write Linux commands one by one. Once you have all your commands, save the file as a .sh file.

Next, make your script executable. You can achieve this with the command

chmod +x filename.sh

You now have an runnable scirpt. So how do you run it?
Use the command below:

./filename.sh

Many more details in the Youtube video. Hope this helps :-)

Top comments (0)