To run a script in Linux, follow these steps:
-
Make sure the script is executable. If your script is named
script.sh, you can make it executable with the following command:chmod +x script.sh -
Run the script. You can execute the script by using:
./script.sh
If you want to run the script in the background, append an ampersand (&) at the end:
./script.sh &
This will allow the script to run in the background while you continue using the terminal.
