: SortingFormat:Sort [OPTION] ... [FILE] ...Options:-N: Sort based on numeric size instead of characters;-T CHAR: Specifies the delimiter;-K #: The field used for sorting comparisons;-R: Reverse order;-F: Ignore character case-U: Duplicate lines retain only one copy;Repeating rows: continuous and identical;Example:[Email protected] sh]# sort-t:-K 3-n/etc/passwd[Email protected] sh]# sort-t:-K 3-n-r/etc/passwdUniq: report or remove duplicate rowsFormat:Uniq [OPTION] ... [INPUT [OUTPUT]]Options:-C
regular Expression BRE extended regular expression ERECharacter matching:. Match a single arbitrary character[] matches any single character within the specified range[^] matches any single character outside the specified rangeNumber of matches: * matches the preceding character any time, including 0 position anchoring: ^ Meow at the beginning of the line. * Match any character any time $ line end Meow\? Matches the preceding character 0 or 1 times ^$ represents a blank line ^pattern$ used for
' [: #/] ' {print NF} ' helloworld.sh specifies three separators and outputs the number of fields per rowAwk-f ' [: #/] ' {print $1,$2,$3,$4,$5,$6} ' helloworld.sh tab-delimited output multi-fieldApplication 4calculate the size of the normal file in the/home directory, use KB as the unit , int is the meaning of roundingLs-l|awk ' begin{sum=0}!/^d/{sum+=$5} end{print "Total size is:", sum/1024, "KB"} 'Ls-l|awk ' begin{sum=0}!/^d/{sum+=$5} end{print "Total size is:", int (sum/1024), "KB"} ' appli
=" Http://s1.51cto.com/wyfs02/M02/7A/37/wKiom1alvg_xEQYNAAAUS7Ts9i0693.png "title=" User.png "alt=" Wkiom1alvg_xeqynaaaus7ts9i0693.png "/>Displays the shell for the account and account, and the TAB key between the account and the shell650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/7A/37/wKioL1alv1ej_LDzAAAh7atkY0o125.png "title=" Awk.png "alt=" Wkiol1alv1ej_ldzaaah7atky0o125.png "/>3. Retrieving IP650) this.width=650; "style=" width:630px;height:326px; "src=" http://s5.51cto.com/wyfs
-vj5fu175.png "/>If you want to add content before, change A to I is OK.650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/7A/2F/wKioL1alj0bhwRUMAAAeZkhnINc569.png "title=" Add.png "alt=" Wkiol1alj0bhwrumaaaezkhninc569.png "/>5. Display only one of these lines, such as:650) this.width=650; "style=" width:558px;height:245px; "src=" http://s3.51cto.com/wyfs02/M00/7A/2F/ Wkiol1alkekwxvoaaaamwc_7txw064.png "title=" "alt=" Wkiol1alkekwxvoaaaamwc_7txw064.png "border=" 0 "height=" 245 " Hspace=
1, find and replace[email protected] oldboy]# cat Test.txtOldboy[[Email protected] oldboy]# sed ' s#oldboy#gongli#g ' test.txt #me: Just modified the output, the original file did not changeGongli#me: s---Replace, g--global Replace, n--cancel default output, p--print required, e--edit#me: If the replaced content is empty, it is cut and can be used to intercept the function.[[email protected] oldboy]# sed-i ' s#oldboy#gongli#g ' test.txt #me:-I parameter is directly modified file[email protected]
Requirement: Replace the contents of all. sh files in the directoryRealize:Ls/dataA.txt b.sh c.sh D.infoMethod 1-----------------------------------------------------------See the pre-replacement content firstFind-type f-name "*.sh" |xargs CatBeforeBeforeTest replacement results, only print output when SED has no parametersFind-type f-name "*.sh" |xargs sed ' s#before#after#g 'AfterAfter-I parameter to replace changes in the fileFind-type f-name "*.sh" |xargs sed-i ' s#before#after#g 'View the po
;>>>> A[::-1][9, 8, 7, 6, 5, 4, 3, 2, 1]>>>>>> A[::4] #步长为四[1, 5, 9] six. Derivation list [expression for variable in list] or [expression for variable in list if condition]For example, suppose we want to create a list of square numbers, such as:>>> squares = []>>> for x in range (10):... squares.append (x**2)...>>> Print (squares)[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]>>>We can also get the same list in the following way:>>> squares = [x**2 for x in range (10)]>>> [x**2 for X in range (10)][0, 1,
Tags: awkHttp://www.cnblogs.com/ginvip/p/6352157.htmlThis is a blog I found, the content of awk is written very well, need to seeawk about! No.(1) Take odd lines[[email protected] shell]# SEQ 10 | awk ' I=!i '13579(2) Take even lines[[email protected] shell]# SEQ 10 | awk '! (i=!i) '246810(3) SEQ 10 not after 4 lines[[email protected] shell]# SEQ 10 | Head-n-4123456This article is from the "It Life" blog, so be sure to keep this source http://dingxue.blog.51cto.com/12290895/1974369awk sed (4) =
, and if multiple lines are matched, the contents of file will be displayed under all matching lines below $ sed '/test/r file ' filesWrite file: w command# All rows containing Test in files are written to file $ Sed-n '/test/w file ' filesAppend (line): A\ command# Append the IS-a test line to the row that begins with test $ sed '/^test/a\the is a test line ' files insert the is a test line$ sed ' 4a before the 4th row of the files file \the is a Test line ' filesNext: N command# If book is mat
]:~/linux/awk$awk--re-interval'$2~/192\.168\. [0-9] {1,3}\. [0-9] {1,3}/{print}'host.txt host1192.168.1.1Host4192.168.3.98Host5192.168.3.98Host6192.168.9.254$: The 2nd column, followed by the ~ indicates that the second column matches the result of the regular expression followed by the true, execute action, here is the print current line {print}, if added! is to take the counter[Email protected]:~/linux/awkawk'$2!~/192\.168\.[ 0-9]{1,3}\. [0-9] {1,3}/{print}' host.txt name IP address host2
spaceG keep space covered to pattern spaceG hold space append to mode spacex keep space and mode space content interchangeableThe next line of n rows is overwritten to the pattern spaceThe next line of N rows is appended to the mode spaceD keep the last lineD Delete Pattern space rowsExample:(1) Output even line[[Email protected] ~] # 2468(2) Show only odd lines[[Email protected] ~] # 13579(3) Reverse output[[Email protected] ~] # seq 1 |sed-n ' 1! G;h, $p '10987654321(4) Output countdown aft
For the users of Photoshop software, let's talk about oil painting filters to quickly make oil painting.
Tutorial Sharing:
Original:
Turn the background into a smart object
Here are two ways to apply oil-painting filters. The first is the direct application, such operations will be the image of the picture for permanent changes, once we turn off PS and then
In the hands of the painting, hair processing is a big problem, after all, we often encounter low pixel photos or the image of the hairstyle is not satisfied. There's no way we can handle hair at this point,
You don't have to be careful with these questions, you want to have hair, long hair, straight hair curls, you design. (The idea is a bit dreamy, for us amateurs, it's too much difficulty,
But as long as you have the determination to be patient y
Hand-painted is the use of image processing tool PS, the character or landscape photos into a similar freehand effect of a picture processing method. Today we are going to look at the clothes in the hands of the practice of painting.
In the process of making a painting, we must pay attention to the following details, determine the success or failure of the results.
First: Skin effect. Many excellent hand-
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.