Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用此命令删除所有重复的行:
sort file.txt | uniq -u
但它只显示终端中的所有唯一行。我需要更改什么以使其创建一个名为 newfile.txt 的新文件,所有唯一行都在其中?
只是重定向到一个文件
排序文件.txt | uniq -u > newfile.txt