There are two ways to run .sh files in Linux system. For example, I have a datelog.sh file in the root directory. The first method (this method requires chmod to make the file executable (x): chmod u+x datelog.sh): 1. In any path, enter the absolute path of the file /root/datelog.sh to execute the file (of course, if the permission is allowed) 2. cd to the directory of the datelog.sh file, and then execute ./datelog.sh The second method (this method does not require the file to have executable permissions to run): 1. Add the file name to the file path, sh datelog.sh 2. In any path, add the file path and file name to sh: sh /root/ datelog.sh Double-click the sh file in the desktop environment to run: Mac: 1. Change the suffix sh to command: hello.sh->hello.command 2. Modify the executable permission: chmod u+x hello.command Ubuntu: 1. Modify the executable permission: chmod u+x hello.sh 2. Open any folder and select [Edit] -> [Preferences] in the upper left corner. Select [Run executable text files when opening them] to double-click to run. The above is the full content of this article. I hope it will be helpful for everyone’s study. I also hope that everyone will support 123WORDPRESS.COM. You may also be interested in:
|
<<: A simple way to implement all functions of shopping cart in Vue
>>: What you need to understand about MySQL locks
Table of contents Preface LED Trigger Start explo...
Preface I have been summarizing my front-end know...
Table of contents 1. Install vmware 1.1 Download ...
Table of contents Primary key index Create indexe...
Carousel animation can improve the appearance and...
Add the following code to the CSS style of the el...
In the nginx process model, tasks such as traffic...
Table of contents Ideas Host Configuration Modify...
1. Introduction table_cache is a very important M...
Take the deployment of https://gitee.com/tengge1/...
Table of contents 1. Implementation of counter 2....
After solving the form auto-fill problem discussed...
Links to the current page. ------------------- Com...
Method 1: Using the onclick event <input type=...
To do MySQL performance adjustment and service st...