Linux batch file writing (1) linux batch file, basically 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) in the console to grant the script executable permission: chmod 777 clean and then directly execute :. /clean other functions will be added later .... (2) in linux, the batch processing file is basically a shell script file. The simplest way to write a script is: 1. Create a new file named test (your own name) nano test. the following line is required to write a script in the directory (the first line of the file is required ):#! /Bin/sh #! 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 pcsudo shutdown + 1 3. execution method (1) enter the command on the console to execute: sh test. sh (2) give the script executable permission first. Double-click the file and right-click the file and choose Properties> permission. At the bottom of the page, a "allow program execution file" option is selected, you can. Or attach the permission chmod 777 test. sh or: chmod + x test. sh to the command line.