Macos – gedit something in Mac’s Terminal


When I was using a Linux laptop as my dev machine, I used to do "gedit xxxx" in a Terminal. Now I just switched to MacBook, I d like to do the same thing.

I know that I can open gedit in a command line like "open gedit", but can I add the file name? Otherwise I have to use vim. I am not a fan of vim.

Best Solution


alias gedit="open -a gedit"

to ~/.bash_profile :

Now you'll be able to gedit directly from the command line.