142k views
2 votes
If you wanted to run/execute a script called my-script, what would you type in the Linux terminal shell to accomplish this?

A) run my-script
B) execute my-script
C) start my-script
D) ./my-script

1 Answer

3 votes

Final answer:

option d,In the Linux terminal, to run a script called my-script, type './my-script' after ensuring it has execute permissions.

Step-by-step explanation:

To run a script called my-script in the Linux terminal shell, you would type the following command: D) ./my-script. The ./ prefix specifies that the script is in the current directory, and it is a common way to execute a script or program from the terminal. If it fails to run, you might need to add execute permissions to the script by running chmod +x my-script first.

To execute a script called my-script in the Linux terminal shell, you would type ./my-script. The ./ before the script name represents the current directory, and it is required to run the script. This is because by default, Linux does not include the current directory in the system's search path.

User Kervens
by
8.0k points