Linux task ManagementThere are two types of task management under Linux , each of which is one-time and periodic . Disposable is at and the Batch, periodicity is divided into the system regardless of what and user tasks .Disposable Tasks :1.
Reference from Linux command DaquanTo see if the shell command is a shell built-in command, use the type to determine:
$ Type cdCD is a shell builtin$ Type pingPing is/bin/ping
All built-in commands are as follows:ShThe
from Import Models class Person (models. Model): = models. Charfield (max_length=30) = models. Integerfield () def__unicode__(self): # Use the Def __str__ (self) return self.name in Python3$python manage.py Shell>>>from
One, do not want to manually enter the method1. Install expect tool: sudo apt-get install tcl TK expect2. The contents of the script file are as follows:#! /usr/bin/expectSpawn sudo apt-get updateSend "zhoushuo\r"InteractSecond, want to manually
#! /bin/shLook for Shell interpreter/bin/sh is a path#! /usr/bin/pythonJust looking for a Python interpreter.Ways to execute a Linux program:Enables the file to execute directly with executable permissionsInvoke the interpreter to runUse Source to
3 Kinds of TEST commands:Test EXPRESSION[EXPRESSION][[EXPRESSION]]Note: You must have a white space character before and after expressionTest type of BashNumerical test:-eq: Is it equal-ne: Whether or not to wait-ge: is greater than or equal to-le:
Reference: http://www.cnblogs.com/binbinjx/p/5680214.htmlWhen doing bulk software installation automation, you like to use the configuration file to change the parameters, how to read the configuration file configuration through the shell? Refer to
Personal configuration is mainly concentrated in the ~/.profile file.When you open a new interactive shell, the order in which the configuration files are executed is/ETC/PROFILE/ETC/BASHRC ~/.profile and finally ~/.BASHRCEnvironment variables--can
Shell reads each line of the fileWriting one:----------------------------------------------------------------------------#!/bin/bashWhile Read lineDoEcho $lineDone ----------------------------------------------------------------------------Two:------
DirectoryFirst, Shell Basic use of scripts1. Language Specification2. Variables3. Redirect (>,>>)Second, operators and common judgments1. Comparison operators2. Logical operators3. Common JudgmentsThird, the program structure1. Branch (if statement)2
1.Follow"File Type"to Judge(presence or not)- e:does the "file" exist? exist as true(Common)-F:is the "file" aNormalfile(file)? (Common)- D:whether the "file" is a directoryfile(directory)? (Common)- b:whether the "file" is ablock device files
2.1.1 Parameters for shell scriptsCommon parameters(1) * A string to display the parameters passed to the script, and the location variable, this parameter can be more than 9(2) @ start at parameter 1, show all parameters passed to the script, and
grep-a digital search to show the next line of information650) this.width=650; "height=" 290 "src=" http://b176.photo.store.qq.com/psb?/81c1194a-ff39-4e50-b1b1-40057b06260f/
awk is also a data processing tool and is a basic language that can customize variables, loop array regular functions, etc.awk-f delimiter ' commands command ' file' Condition {Execute} ' condition {execute} ' multiple conditions can use various
Use tail--help to view commands for memotail [-f] [-c number | -N Number | -M number | -B number | -K number] [File]Usage:tail [OPTION] ... [FILE] ...Print the last ten lines of each FILE to standard output.With more than one file, precede each
Variable: Stores the memory space of a single element;Array: A contiguous memory space that stores multiple elements;Array name: The entire array has only one name;Array index: numbering starting from 0;Array name
Bash features multiple command executions, such as: # COMMAND1 $ (COMMAND2), and communication between Processes (IPC): # COMMAND1 | COMMAND2 ...I. Command execution structure and algorithmIn command execution, there are sequential execution
Several Methods for executing shell
This section describes four methods for python to execute shell commands:
1. the OS. system () function in the OS module executes shell commands.
Note: This method cannot be output by shell commands.
2. popen ()
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