Can linux cat command be used for writing text to file?

后端 未结 12 1357
南方客
南方客 2021-01-29 19:03

Is something like this:

cat \"Some text here.\" > myfile.txt

Possible? Such that the contents of myfile.txt would now be overwr

12条回答
  •  醉酒成梦
    2021-01-29 19:43

    You can do it like this too:

    user@host: $ cat< file.txt
    $ > 1 line
    $ > other line
    $ > n line
    $ > EOF
    user@host: $ _
    

    I believe there is a lot of ways to use it.

提交回复
热议问题