Home  >  Article  >  Operation and Maintenance  >  How to run sh on centos?

How to run sh on centos?

coldplay.xixi
coldplay.xixiOriginal
2020-07-06 15:18:3115711browse

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 on centos?

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:

centos tutorial

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!

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Previous article:How to shut down centos7?Next article:How to shut down centos7?