How can I create and open a file from terminal with a single command?

后端 未结 8 1326
野性不改
野性不改 2020-12-24 06:56

To create a file from terminal I type the following...

$ touch filename.py

To open the file I just created from terminal, I then type...

8条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-24 07:31

    This is as lazy as one can get:

    $ echo "your text" > myfile.txt
    

提交回复
热议问题