Can I gedit something in Mac's Terminal

Xi 张熹 picture Xi 张熹 · Jan 26, 2012 · Viewed 36.3k times · Source

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.

Answer

jwalk picture jwalk · Dec 6, 2012

Add

alias gedit="open -a gedit"

to ~/.bash_profile :

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