(1) in Linux, the batch processing file is basically a shell script file. 1. the simplest way to write a script is to create a new file named "clean" and write Rm-FV * in it *. o; LS-Al; (you can write some common shell commands, which are separated by semicolons) 2. execution Method
(1) Enter:
Sh clean
(2) grant the script executable permission: chmod 777 clean and then directly execute:./clean to add other functions one after another .... (2) in Linux, the batch processing file is basically a shell script file.
The simplest script writing method is:
1. Create a new file named test)
Nano test. Sh
2. write scripts in it
The program must start with the following line (must begin with the first line of the file ):
#! /Bin/sh
Symbol #! The parameter used to tell the system that the program is used to execute the file. In this example, we use/bin/sh to execute the program.
(You can write some common shell commands separated by semicolons)
Example:
#! /Bin/bash
# Shutdown PC
Sudo shutdown + 1
3. Execution Method
(1) run the following command on the console:
Sh test. Sh
(2) give the script executable permission first, and double-click to execute:
Right-click the file and choose "properties"> "Permissions". At the bottom of the page, you can select "Allow File Execution by program.
Or attach the following permissions to the command line:
Chmod 777 test. Sh
Or: chmod + X test. Sh