<分区>
我有一个文件看起来像
1254543534523233434
3453453454323233434
2342342343223233535
0909909092324243535
bash 中是否有一种方法/命令可以根据特定子字符串删除上面文件中的重复项,而不更改它们在输出中的顺序?
即
(带子串 -> ${line:11:8}
1254543534523233434
2342342343223233535
0909909092324243535
我知道:
sort -u : sorts them numerically, then removes duplicates
sort -kx,x -u : The same
cat filein | uniq : requires them to be sorted already or it will not work
我想弄清楚是否有一个本地 linux 解决方案,而不必为它解析 perl 代码。提前谢谢你。