How to run the. sh file __linux Linux system

Source: Internet
Author: User
Tags chmod

There are two ways to run the. sh file under the Linux system, for example, I have a datelog.sh file in the root directory.


The first (this approach requires the use of chmod to make the file conditional on execution (x): chmod u+x datelog.sh):

1, in any path, enter the absolute path of the file/root/datelog.sh can execute the file (of course, if permission is allowed)


2, CD to the directory of the datelog.sh file, and then execute./datelog.sh



The second (this method does not require the file to have executable permissions can also run): 1, in the file path under SH Plus file name can be, SH datelog.sh


2, in any path, SH plus file path and file name: sh/root/datelog.sh


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.