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

查看:27
本文介绍了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天全站免登陆