Bash 通过终端向tsv文件添加头
我有许多tsv文件是无头的,我想为每个文件添加相同的头。如何通过终端或bash实现这一点 谢谢Bash 通过终端向tsv文件添加头,bash,unix,Bash,Unix,我有许多tsv文件是无头的,我想为每个文件添加相同的头。如何通过终端或bash实现这一点 谢谢 sed -i '1i \here comes header' files 文件可以是glob exp,比如*.txt假设“head”中有header,tsv文件是“body”,那么猫头body|tee body你能解释一下1i的作用吗?行1,执行insert或cat-filein>fileout您需要类似..>fileout和&mv fileout filein的内容来保存“就地”@Kent刚刚学
sed -i '1i \here comes header' files
文件可以是glob exp,比如
*.txt
假设“head”中有header,tsv文件是“body”,那么猫头body|tee body
你能解释一下1i
的作用吗?行1
,执行insert
或cat-filein>fileout您需要类似..>fileout和&mv fileout filein
的内容来保存“就地”@Kent刚刚学习了tee命令,非常有趣