Home  >  Article  >  Operation and Maintenance  >  How to run programs in linux

How to run programs in linux

angryTom
angryTomOriginal
2019-11-06 14:25:445642browse

How to run programs in linux

How to run the program on Linux

1. chmod space "x" space your sh file name (x is A whole, do not take it apart).

2. Enter "./your sh file name" to execute.

Example:

1 chmod x helloworld.sh.

2 ./helloworld.sh.

First of all, you need to give the file executable permissions. For example, if your file is a.sh, then you can chmod x a.sh; and then run the file.

When running in this way, a.sh is in the current working directory. If the file is not in the current directory, then you need to use an absolute path to execute, such as: /opt/a.sh; /opt/test/a.sh .

Recommended: Getting started with Linux system

The above is the detailed content of How to run programs in linux. 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