cat和fold unix命令之间的差异
我想知道下面两个命令cat和fold unix命令之间的差异,unix,cat,Unix,Cat,我想知道下面两个命令cat和fold之间的区别?我只是 使用了fold命令,其作用类似于cat命令 fold file1.txt cat fold.txt (both are using to display the contents of the file) 检查他们的主页 man fold fold - wrap each input line to fit in specified width man cat cat - concatenate files and print on t
cat
和fold
之间的区别?我只是
使用了fold
命令,其作用类似于cat
命令
fold file1.txt
cat fold.txt (both are using to display the contents of the file)
检查他们的主页
man fold
fold - wrap each input line to fit in specified width
man cat
cat - concatenate files and print on the standard output
使用fold
可以指定宽度,而cat
中没有此类选项,请检查它们的手册页
man fold
fold - wrap each input line to fit in specified width
man cat
cat - concatenate files and print on the standard output
使用
fold
可以指定宽度,而cat
fold
-折线过滤器中不存在此类选项。这将断开行,使列位置(或字节)的最大宽度为x
示例
:fold-5 myfile.txt>newfile.txt
在上面的命令中,这将把myfile.txt的行折叠为5个字符的宽度,并将结果重新路由到文件newfile.txt
cat
-允许您读取文件的内容
示例
:cat file1.txt file2.txt>file3.txt
读取file1.txt和file2.txt,并将这些文件组合成file3.txt。
折叠
-用于折叠行的过滤器。这将断开行,使列位置(或字节)的最大宽度为x
示例
:fold-5 myfile.txt>newfile.txt
在上面的命令中,这将把myfile.txt的行折叠为5个字符的宽度,并将结果重新路由到文件newfile.txt
cat
-允许您读取文件的内容
示例
:cat file1.txt file2.txt>file3.txt
读取file1.txt和file2.txt,并将这些文件组合成file3.txt。
fold
命令在cat
显示文本而不换行时换行文本:
fold
命令在cat
显示未包装的文本时包装文本:
谢谢@fedorqui。是的,我们不能说“软呢帽”。是的,我们不能