- 论坛徽章:
- 6
|
# ༺ ༻ # ➜ cat f3-1.xy;cat f3-2.xy
250 #打印如果它包含AAA或BBB或CCC
65字或更长的255 #只打印线
不超过65个字符的259 #只打印线
264 #打印部分文件从正则表达式到文件结束
268 #打印部分文件基于线数(线8-12,包容)
273 #打印行数52
279 #开始3行,每第七行
284 #打印部分文件的两个正则表达式之间(含)
289 #打印所有文件除2正则表达式之间的部分
293 #删除复制,从一个文件连续行(模仿“ 唯一性”)。
保持295 #第一行集合中的重复行,其余部分被删除。
299 #删除复制,从一个文件中不连续的线。注意不要
301 #溢出保留空间的缓冲器的大小,否则使用GNU sed。
305 #删除重复行的所有行(模仿“ uniq -d”)。
309 #删除一个F的前10行
250 # print paragraph if it contains AAA or BBB or CCC
255 # print only lines of 65 characters or longer
259 # print only lines of less than 65 characters
264 # print section of file from regular expression to end of file
268 # print section of file based on line numbers (lines 8-12, inclusive)
273 # print line number 52
279 # beginning at line 3, print every 7th line
284 # print section of file between two regular expressions (inclusive)
289 # print all of file EXCEPT section between 2 regular expressions
293 # delete duplicate, consecutive lines from a file (emulates "uniq").
295 # First line in a set of duplicate lines is kept, rest are deleted.
299 # delete duplicate, nonconsecutive lines from a file. Beware not to
301 # overflow the buffer size of the hold space, or else use GNU sed.
305 # delete all lines except duplicate lines (emulates "uniq -d").
309 # delete the first 10 lines of a file
313 # delete the last line of a file
317 # delete the last 2 lines of a file
321 # delete the last 10 lines of a file
329 # delete every 8th line
334 # delete lines matching pattern
338 # delete ALL blank lines from a file (same as "grep '.' ")
343 # delete all CONSECUTIVE blank lines from file except the first; also
345 # deletes all blank lines from top and end of file (emulates "cat -s")
351 # delete all CONSECUTIVE blank lines from file except the first 2:
355 # delete all leading blank lines at top of file
359 # delete all trailing blank lines at end of file
364 # delete the last line of each paragraph
# [ /home/soio/1bs/awks ] {2018-03-16 11:45:36} : 1521171936:0;
# ༺ ༻ # ➜ awk 'NR==FNR{a[$1]=$0; next} { if ($1 in a){b[$1] = $0}} END {for (i in a){ print a[i]; print b[i] }}' f3-1.xy f3-2.xy
不超过65个字符的259 #只打印线
65字或更长的255 #只打印线
保持295 #第一行集合中的重复行,其余部分被删除。
250 #打印如果它包含AAA或BBB或CCC
250 # print paragraph if it contains AAA or BBB or CCC
264 #打印部分文件从正则表达式到文件结束
264 # print section of file from regular expression to end of file
268 #打印部分文件基于线数(线8-12,包容)
268 # print section of file based on line numbers (lines 8-12, inclusive)
273 #打印行数52
273 # print line number 52
279 #开始3行,每第七行
279 # beginning at line 3, print every 7th line
284 #打印部分文件的两个正则表达式之间(含)
284 # print section of file between two regular expressions (inclusive)
289 #打印所有文件除2正则表达式之间的部分
289 # print all of file EXCEPT section between 2 regular expressions
293 #删除复制,从一个文件连续行(模仿“ 唯一性”)。
293 # delete duplicate, consecutive lines from a file (emulates "uniq").
299 #删除复制,从一个文件中不连续的线。注意不要
299 # delete duplicate, nonconsecutive lines from a file. Beware not to
301 #溢出保留空间的缓冲器的大小,否则使用GNU sed。
301 # overflow the buffer size of the hold space, or else use GNU sed.
305 #删除重复行的所有行(模仿“ uniq -d”)。
305 # delete all lines except duplicate lines (emulates "uniq -d").
309 #删除一个F的前10行
309 # delete the first 10 lines of a file
|
|