前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >BashBites:How to Append Outputs to a File

BashBites:How to Append Outputs to a File

作者头像
技术小黑屋
发布2018-09-04 16:23:58
4120
发布2018-09-04 16:23:58
举报
文章被收录于专栏:技术小黑屋技术小黑屋

Is there any way to append output(debugging information) to a existings file? As we all know in bash the command ‘>’ will write ouputs to a file.However this command will also erase the existing data it the file. Of course bash provides a command that appends outputs to a file.It resembles ‘>’.It’s ‘>>’ The following is a piece of example code.

Let’s look at >

1 2 3 4 5 6 7 8

[androidyue@androidyue tmp]$ touch a.txt [androidyue@androidyue tmp]$ cat a.txt [androidyue@androidyue tmp]$ echo "ABC" > a.txt [androidyue@androidyue tmp]$ cat a.txt ABC [androidyue@androidyue tmp]$ echo "DEF" > a.txt [androidyue@androidyue tmp]$ cat a.txt DEF

Well,Let’s look at the exiciting command >>

1 2 3 4

[androidyue@androidyue tmp]$ echo "GHI" >> a.txt [androidyue@androidyue tmp]$ cat a.txt DEF GHI

本文参与 腾讯云自媒体分享计划,分享自作者个人站点/博客。
如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体分享计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • Let’s look at >
  • Well,Let’s look at the exiciting command >>
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档