Add a header to a tab delimited file

前端 未结 8 847
北恋
北恋 2020-12-14 21:46

I\'d like to add a header to a tab-delimited file but I am not sure how to do it in one line in linux.

Let us say my file is:



        
8条回答
  •  Happy的楠姐
    2020-12-14 22:45

    cat <(head -1 theFileWithHeader) theFileWithoutHeader > newfile;
    mv newfile theFileWithoutHeader;
    

提交回复
热议问题