To run a shell script (.sh file) in the Linux command line, you can follow these steps:
- Open a terminal or command line interface.
- Navigate to the directory where the shell script is located using the cd (change directory) command, for example:
- Make sure the shell script has executable permissions. You can use the chmod command to change the file permissions, for example:
chmod +x script.sh
- Run the shell script using the following command:
Replace 'script.sh' with the actual name of your shell script.
This will execute the shell script, and you should see the output or any changes made by the script in the terminal.