A. Cut (truncate text characters or field fields)Command format: Cut [option] FileCombined use of 1.-d and-F to intercept fieldsDescription: * denotes delimiter, such as-,:, empty characters, etc.n Denotes nth fieldUsage One: cut-d*-fn to intercept
General format of the awk command:awk ' {pattern + action} ' {Filenames}Call awk:1. Command-line mode:awk[-F Field-separator]'commands'input-file(s) commands is the real awk command, [-f Domain delimiter] is optional. input-file(s) is the file to be
There are many different shell scripts in Linux, but we usually use bash (bourneagainshell) for shell programming, because bash is free and easy to use. Therefore, in this article, all the scripts provided by the author use bash (but in most cases,
The following is a summary of linux_Shell programming. If you need it, you can check it out. Why is shell programming in Linux? Although there are various graphical interface tools, kernel is still a very flexible tool. Shell is not only a
In Linux, although there are various graphical interface tools, shell is still a very flexible tool. Shell is not only a collection of commands, but also a very good programming language. You can use shell to automate a large number of tasks. shell
1. Linux script compiling Basics
1.1 Basic syntax Introduction
Start with 1.1.1
The program must start with the following line (must begin with the first line of the file ):
#! /Bin/sh
Symbol #! The parameter used to tell the system that the program
SED command:SED options "Address delimitation Edit command" FILE ...Options:- n silent mode, does not output content in the mode space- R extended Regular expression-f/path/to/script_file specifying sed script files-E ' script '-e ' script '
Cat: Connect and display-N: Numbering all lines of the output-e: Show $ at end of each lineSplit screen display: more, lessHead: View top n rows, n defaults to 10-NTail: To view the following n rows, n defaults to 10-NCut-D: Specifies the field
Diffdiff file File1 to compare two different files-C display rows around the top and bottom-U uniformly output patches in a certain format-R comparison of files in two directoriesPatch File File.path Patching-B Plus-B backup source filesgrepgrep Key
Du-sh * shows the size of some files Df-h is there any remaining disk space?-a All file system list-H easy-to-read display of 1k=1000 instead of 1k=1024 copy source resources to target directory scp-r [email Protected]:/roo
View text: Cat, TAC, more, less, head, tailCat: Connect and display
-N
-E
Split screen display: more, lessHead: View Top N rowsTail: View after n rows
-N
Tail-f: Look at the end of the file, do not exit, wait to
SED command:Sed is an online editor that processes a single line of content at a time. When processing, the currently processed rows are stored in a temporary buffer called pattern space, followed by the SED command to process the contents of the
To view text:1.cat: Connect and display textInverted display of the Tac:cat-N: Add rows at the beginning of each line display-E: line breaks displayed per row-A: Displays all, including text and various special symbolsThe text newline character for
Three barriers for technician growth:The ancients succeeded in the three sentences, the ancient people to become major events, the need to go through the triple State:First goal: Find the direction, set the targetThe second goal: tireless, support
1. For command (1) syntax for Val in list; Do commands doneThe list parameter provides some values for the iteration, and the Val value is assigned to the value in list, knowing that the list polling ends.Commands can be one or more
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.