Home > Article > Operation and Maintenance > How to run sh on centos?
How to run sh files in centos: 1. Set permissions first, the command is [chmod x ****.sh]; 1. Directly [./] plus the file name [.sh] to run; 2 , directly sh plus the file name [.sh].
How to run sh file in centos:
1. Add directly ./
The file name is .sh
, for example, when running hello.sh, it is ./hello.sh [hello.sh must have x permissions]
2. Direct sh and add the file name .sh
, such as running hello.sh as sh hello.sh [hello.sh can not have x permissions]
If there is no permission. Then set the permissions first, the command is as follows:
chmod + x ****.sh
cd to ****.sh
#Under the file path
./****.sh
#Execute this ****.sh file
##Related learning recommendations:
The above is the detailed content of How to run sh on centos?. For more information, please follow other related articles on the PHP Chinese website!