Linux Shell shortcut keys

CommonCtrl+r: Quick Search History Command (Retrieve)Ctrl+u: Delete entire command line text character (Unity)Ctrl+s: Pausing a Running program (STOP)Ctrl+q: Exit Pause (quit)CTRL + Z: Enables tasks that are running in the terminal, running in the

Shell Programming------Function Application

1. The return value of the Shell function:In general, a return of 0 indicates a successful run, and a non-0 return indicates a failure. For a view of the return value, use the $? command.2. Incoming parameters for Shell functions:Use the location

Shell Programming (i)

[TOC] Shell programming (i) a shell introduction 1 concept? Command interpreter2 common shellsbash linux标准shellsh 早期shell,较简单csh ksh tcsh unix shellvi /etc/shells linux支持的shell3 shell scriptsExample 1:#!/bin/bashecho "hello

Shell Programming Exercises

Topic One: Summation exercise:#!/bin/bashfunction Sumarray {Local sum=0Local arrayArray= (echo "[email protected]")For value in ${array[]}Dosum=$[$sum + $value]DoneEcho $sum}Wang= (1 2 3 4 5)echo "Initial data is: ${wang[]}"Kai=echo ${wang[*]}result=

Description of the Shell's conditional expressions

Determine if b.txt This file exists, there is output 1, there is no output 0[-F B.txt]&& echo 1| | Echo 0-F: Determines whether the file is-E: Determine if the file exists-D: Determine if the directory-R: Judging whether it is readable-W: Determine

Shell Script application (if statement's structure)

1, test: the detection of the expression is established, the return value is 0, otherwise, not 0Method:1) test expression2) "Expression"2. File test:-D: Whether it is a directory-F: Whether it is a file-E: whether there is-r: Whether Read permission

Conditional testing and comparison of shell scripts

Conditional test Syntax:Syntax 1:test This is the method of conditional test expressions with the test command.Syntax 2:[]: This is the way to test an expression with a single parenthesis, as with the use of the test command, the recommendedSyntax 3

NOTES: Linux--First knowledge shell

One: Word accumulationCurrent: currentlyDirectory: Directories Entries: ArticlesDefault: DefaultsInformation: InformationFormat: FormattingIgnore: NeglectLicensing: LicensingTwo:1.GNU Bash Description: The shell is the user interface of the Linux

Using the shell to read a text file sent to Kafka

#!/bin/SH# # parameter definition dt=`Date+"%y%m%d"-D"-1 days"' Outpath=/xxxx_log_${dt}.txt brokerlist=192.168.1.:9092,192.168.1.101:9092,192.168.1.102:9092Echo$dt $outpath $brokerlist # # Query hive table, output file to the specified path

In-Shell date operations

1. date-d operationDate +"%y%m%d" -D "+ndays" #今天的后n天日期 Date +"%y%m%d" -D "-ndays" #今天的前n天日期2. Common Date format outputDate+"%F"#输出: -- .- ,Date+"%d"#输出: ./ ,/ ADate+"%y%m%d%h:%m:%s"#输出:20120608 Geneva: the: -Date+"%y%m%d"#输出:2

8.6 Pipe character and job control 8.7/8.8 shell variable 8.9 environment variable configuration file

Five week fourth session8.6 Pipe symbol and job control8.7/8.8 Shell variables8.9 environment variable configuration file8.6 Pipe symbol and job controlPipeline compliance with Job controlTasks to stop: jobsMove the task to the front desk: FGTask is

Shell Script--File test

A file test is a test of whether a file or directory existsTest file format [operator directory or file] Note that there is a space between the opening parenthesis and the operator, and there is a space between the file or directory and the

Shell Terminal terminfo Command tput

Tput commandtputYou can change terminal features, such as moving or changing the cursor, changing text properties, clearing specific areas of the terminal screen, and so on.Cursor PropertiesIn a shell script or command line, you can change the

Shell Script--Numerical calculation

Native bash does not support simple math operationsWhen you are beginner, you can use $ (()) and expr to implementUse $ (()) to achieve:#!/bin/bash# file name: Test.shecho $ ((1+3)) #命令行第2个参数和第3个参数求和 # At this point the + number can be added without

Shell SED Syntax detailed

SED replaces a string in a fileSed-e ' s/foo/bar/' myfile replaces the first occurrence of each line in the MyFile file foo with a string bar , and then outputs the file contents to the standard outputSed-e ' s/foo/bar/g ' myfile g allows SED to

Shell copy operation in addition to a file

Put the app's log with the date name into the archive-specific directory (the log shaving is logging)Find $APPHOME/logs | Grep-v "Info.log\|debug.log\|error.log" | Xargs-i tar-cvzf-c/opt/logs/$DATE. tar.gz {}Date: date= ' Date +%y%m%d%h%m%s 'Find.

Shell Learning Notes

number of logged-in users: who | Wc-l See which users are logged on to the system : who Create a new file /bin/ct11, enter a command in the file,chmod Set the Execute permission for the file # cat >/bin/ct11W.H.O. | Wc-lPress Ctrl+d# Cd/

Writing shell Scripts--judging the user's parameters

Test statement format: [conditional expression]A few common forms:[-D/ETC] to determine if/etc is a directory type,[-e/etc/php.ini] Determine if the/etc/php.ini file exists[-f/etc/php.ini] Judge/etc/php.ini is not a general

Linux Getting Started--shell script Common information summary

$ default variable in 1.shell    $n $ $ for the first argument, and $ for the second argument ... $# Number of command-line arguments the name of the current program               $? The return code of the previous command or

Shell Process Control

Shell Process ControlUnlike Java, PHP and other languages, SH's process control is not empty, such as (the following is the PHP Process Control notation):PHP if (Isset ($_get["q"]) { search (q);} Else { // don't do anything }You can't write

Total Pages: 541 1 .... 337 338 339 340 341 .... 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.