linux文件比较,合并,查找重复行
2010-04-24 16:00
281 查看
关键命令
sort, uniq, cat
合并多个文件
cat file1 file2 > newFile
查看文件中重复行
sort file1|uniq -d
查看文件中唯一行
sort file|uniq -u
更详细的命令,请查看sort, uniq, cat命令的解释
uniq --help
$uniq --help
Usage: uniq [OPTION]... [INPUT [OUTPUT]]
Discard all but one of successive identical lines from INPUT (or
standard input), writing to OUTPUT (or standard output).
Mandatory arguments to long options are mandatory for short options too.
-c, --count prefix lines by the number of occurrences
-d, --repeated only print duplicate lines
-D, --all-repeated[=delimit-method] print all duplicate lines
delimit-method={none(default),prepend,separate}
Delimiting is done with blank lines.
-f, --skip-fields=N avoid comparing the first N fields
-i, --ignore-case ignore differences in case when comparing
-s, --skip-chars=N avoid comparing the first N characters
-u, --unique only print unique lines
-w, --check-chars=N compare no more than N characters in lines
--help display this help and exit
--version output version information and exit
sort, uniq, cat
合并多个文件
cat file1 file2 > newFile
查看文件中重复行
sort file1|uniq -d
查看文件中唯一行
sort file|uniq -u
更详细的命令,请查看sort, uniq, cat命令的解释
uniq --help
$uniq --help
Usage: uniq [OPTION]... [INPUT [OUTPUT]]
Discard all but one of successive identical lines from INPUT (or
standard input), writing to OUTPUT (or standard output).
Mandatory arguments to long options are mandatory for short options too.
-c, --count prefix lines by the number of occurrences
-d, --repeated only print duplicate lines
-D, --all-repeated[=delimit-method] print all duplicate lines
delimit-method={none(default),prepend,separate}
Delimiting is done with blank lines.
-f, --skip-fields=N avoid comparing the first N fields
-i, --ignore-case ignore differences in case when comparing
-s, --skip-chars=N avoid comparing the first N characters
-u, --unique only print unique lines
-w, --check-chars=N compare no more than N characters in lines
--help display this help and exit
--version output version information and exit
相关文章推荐
- Linux查找并删除重复文件的命令行fdupes工具,dupeGuru图形工具
- Linux文件合并去除重复内容
- linux文件合并,去重复
- linux中查找文件并合并文件
- Linux系统中使用fdupes来查找并删除重复文件
- fdupes:Linux 中查找并删除重复文件的命令行工具
- Linux文件合并、去除重复
- Linux 将查找的文件合并成为一个文件
- Linux下find命令---文件的查找和比较
- Linux系统中查找、删除重复文件,释放磁盘空间。
- linux文本排序、交集、差集,查找并删除重复文件脚本、comm命令
- Linux比较并合并文件
- Linux下文本文件合并和去除重复操作
- Linux查找大体积文件,及vim查找统计重复字符出现的次数
- Linux系统中查找、删除重复文件,释放磁盘空间。
- Linux---Linux下文本文件合并和去除重复操作
- LINUX技巧-查找文件行中值重复的行
- linux文件合并,去重复
- Linux入职基础-5.7_文件比较查找(命令实例)
- Linux命令详解1--文件和目录管理之文件查找和比较