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

后端 未结 8 1300
野性不改
野性不改 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:14

    in .bashrc

    lazytouch()
    {
      touch $1
      open $1
    }
    

    then type

    $ lazytouch anything.really
    

提交回复
热议问题