Unix:在没有虚拟文件的情况下添加文件? [英] Unix: prepending a file without a dummy-file?

查看:98
本文介绍了Unix:在没有虚拟文件的情况下添加文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不想要:

$ cat file > dummy; $ cat header dummy > file

我想要类似于下面的命令,但要从头开始,而不要到结尾:

I want similar to the command below but to the beginning, not to the end:

$ cat header >> file


推荐答案

您不能将其附加到文件而不重写文件。您给出的第一种方法是正确的方法。

You can't append to the beginning of a file without rewriting the file. The first way you gave is the correct way to do this.

这篇关于Unix:在没有虚拟文件的情况下添加文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆