Two Methods for running the. sh file in Linux

Source: Internet
Author: User

A medium-level Linux user must always execute the. sh file. Of course, you can double-click the file under the graphic interface, but it is a waste of time.

Now we will introduce the first method: (In ubuntu)
First, open a terminal.
Enter sudo su
Then enter the password. In this way, the root user permission is obtained.
Then find the file (use commands in the terminal, of course, you can choose not to open a file manager .)
Execute./sh file name
You can.

For example, you have a sh file named 1.sh, which is in the/tmp directory of the hard disk. to execute this file, you must:

C code
$ Sudo su
Pass your password: (when you enter the password, you cannot see the entered information, but you have already entered it .)
# Cd/tmp
#./1.sh
$ Sudo su
Pass your password: (when you enter the password, you cannot see the entered information, but you have already entered it .)
# Cd/tmp
#./1. sh.

SH files are similar to batch files in Linux, so you may need to enter some information after running the sh file. This depends on the content of the sh file.

Method 2:
Sh xx. sh
Final suggestion: Use

C code: man sh to see sh introduction ~

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.