Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How To Open A File Using Text Edit In Terminal in MacOS

Another small question. I just recently migrated to ZSH and, so far I am loving it! My question is how can I open a file using TextEdit so that I can edit it using a GUI? Make no mistake, Vim is an amazing command-line tool for editing files in the terminal along with nano.

Let's say that I wanted to open the .zshrc using vim :

vim ~/.zshrc

In the same way, open the .zshrc using nano:

nano ~/.zshrc

How can I open the same ~/.zshrc file using text edit through the terminal?

Thanks a lot and I really appreciate your help :)

like image 756
XtremeDevX Avatar asked Oct 15 '25 11:10

XtremeDevX


2 Answers

Here is the solution, I know it's a bit tedious but, you can open the ~/.zshrc using this command :

open -a TextEdit ~/.zshrc
like image 105
XtremeDevX Avatar answered Oct 18 '25 10:10

XtremeDevX


The open utility has an option -e that opens the file in TextEdit (essentially a shorthand command).

open -e ~/.zshrc
like image 45
Lukas Avatar answered Oct 18 '25 10:10

Lukas



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!