Compiling the next batch processing file in Linux

Source: Internet
Author: User

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.

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.