Shell View System Basic information script

#!/bin/bashecho "IP:" Ifconfig |grep "inet addr" |grep-v 127.0.0.1|awk ' {print $} ' |awk-f ': ' {print $} ' echo ' Product Na Me: "Dmidecode |grep nameecho" CPU info: "Dmidecode |grep-i cpu|grep-i version|awk-f ': ' {print $} ' echo ' Disk info:"

Shell learns 57 days----Linux task management, summarizing and extending to the previous lecture

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.

Linux Shell common Commands

For loopapplist= (App1 app2 app3); for apps in ${applist[@]};d o echo $app;d one; Get IP AddressIfconfig |grep-po ' (? Ifconfig|awk-f "[:]+" ' $4~/[0-9].+[^0-9]+/{print $4}/lo/{exit} 'Ifconfig|sed-nr ' s/^[[:space:]]+inet addr: (. *) bcast.*/\1/p '

Shell all built-in commands

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

The shell operation of the Django template

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

Problem resolution for password input in shell scripts for sudo, etc.

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

Shell Programming Notes

#! /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

Bash shell condition test

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:

How the shell reads the configuration file

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

Shell configuration file

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 file

Shell reads each line of the fileWriting one:----------------------------------------------------------------------------#!/bin/bashWhile Read lineDoEcho $lineDone ----------------------------------------------------------------------------Two:------

Linux Shell Basics

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

Shell Learning condition judgment test

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

Chapter II Fundamentals of Shell programming

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

shell-grep-sed Common usage

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/

Shell-awk Common usage

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

Linux Shell-tail

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

Array of shell script programming

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

Fundamentals of algorithm and Shell scripting programming

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

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 ()

Total Pages: 541 1 .... 346 347 348 349 350 .... 541 Go to: GO

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.