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...
$ open filename.py
I'm curious to know if there is a terminal command that does both...create and then open (I'm super lazy).
In the Terminal app on your Mac, invoke a command-line editor by typing the name of the editor, followed by a space and then the name of the file you want to open. If you want to create a new file, type the editor name, followed by a space and the pathname of the file.
in .bashrc
lazytouch()
{
touch $1
open $1
}
then type
$ lazytouch anything.really
This is as lazy as one can get:
$ echo "your text" > myfile.txt
Simplest way to do this is
touch filename; open filename
Example
touch myfile.py; open myfile.py
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With