A small essay on the shell script of the Linux OPS system engineer series

Source: Internet
Author: User

Shell Essays

I. learn about Shell Programming knowledge Reserve

    1. I told you before, leave homework for everyone. Linux System command application;

    2. Vi/vim Editor's proficiencyin the use of SSH client software settings;

    3. basic services, System services Ntp,crond, network services:NFS,RSYNC,INOTIFY,SERSYNC,SSH,LANMP.

Add: Three ways to empty the log:

    • echo "" > Filename.log

    • >filename.log

    • Cat/dev/null > Filename.log

Note : You can not delete (log) files at work, but only empty the files!

two. creation and execution of shell scripts

1. the first line of the script is generally:#!/bin/bash or #!/bin/sh;

the execution of a 2.shell script is usually performed using bashscript-name or sh script-name;

3. executing the script under the current path, the execution of the shell script usually takes the ./script-name.

Shell Script Execution Instructions ( recommended ) :

Example: XX * * * * /bin/bash/tmp/scripts/bak.sh>/dev/null 2 > 1


This article is from the "Empty Valley Orchid" blog, please be sure to keep this source http://2489843.blog.51cto.com/2479843/1538414

Related Article

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.