Python Learning record--ubuntu (iv) Scheduled Tasks, grep, regular expressions

Source: Internet
Author: User

I. crontab for scheduling tasks :

1. Parameters

(1)-u User: Used to set a user's crontab service

(2)-e: Edit the contents of a user's crontab file. If you do not specify a user, the crontab file for the current user is edited

(3)-L: Displays the contents of a user's crontab file, or displays the contents of the current user's crontab file if no user is specified

(4)-R: Delete a user's crontab file from the/var/spool/cron directory, or delete the current user's crontab file by default if no user is specified

(5)-I: give confirmation prompt when deleting user's crontab file

2. Format:* indicates the week 0~7 (where Sunday can be expressed in 0 or 7) * indicates the month 1~12 * represents the date 1~31 * indicates the hour 1~23 (0 means 0 points) * indicates minutes 1~59 Each xx with * or */1 represents the pre-execute command (do not exceed 64 bytes, if exceeded, write the file after the command: "/bin/bash (Specify absolute path, environment variable can continue to execute) file name" or at the beginning of the file #! /bin/bash then use./execute)

Two. grep is used to find content:

1. Format

grep parameter search for content file name

2. Parameters

(1)-C--count #计算符合样式的列数

(2)-L--file-with-matches #列出文件内容符合指定的样式的文件名称.

(3)-V--revert-match #显示不包含匹配文本的所有行.

(4)-I--ignore-case #忽略字符大小写的差别.

(5)-O # Show only keywords that match

(6)-N # Display line number

(7)-e #使用正则表达式

Three. Regular Expressions:

1. Symbolic Meaning:

(1) ^: match the beginning, put in [] to indicate the inverse, such as [^0-9] represents all non-digital

(2) $: Match End

(3) []: Range Matching

(4) [A-z]: matches all lowercase letters

(5) [A-z]: matches all uppercase letters

(6) [0-9]: Match all numbers

(7). : Matches a single character

(8) *: Indicates that the preceding content (adjacent) appears 0 or more times

(9) +: Indicates that the preceding content (adjacent) appears 1 or more times

(10)? Said the preceding content (adjacent) appears 0 or 1 times

Python Learning record--ubuntu (iv) Scheduled Tasks, grep, regular expressions

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.