Install & Run Gedit from Terminal on Mac



App description: gedit (App: gedit.app)
App website: https://wiki.gnome.org/Apps/Gedit


Install from Terminal




1.Run:

ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" < /dev/null 2> /dev/null ; brew install caskroom/cask/brew-cask 2> /dev/null



2.After the command finishes, run:

brew cask install gedit



Now Gedit is installed.


Run Gedit from Terminal



Solution 1. Add the following line to ~/.profile or ~/.bash_profile:

export PATH=/Users/<Username>/Applications/gedit.app/Contents/MacOS/gedit:$PATH



Solution 2. Create a script named gedit in /usr/local/bin and make it executable:


a. Create a new file:

sudo vim /usr/local/bin/gedit



b. Add content as below, save and quit:

1
2
#!/bin/bash    
/Users/<Username>/Applications/gedit.app/Contents/MacOS/gedit    



c. Make it executable:

sudo chmod 755 /usr/local/bin/gedit



(END)


photo-zzz.png

Hao JiangJustin Time

We only live once, and time just goes by.

  • R&D Engineer @H3C
  • Hangzhou, China

  • Facebook
    微博
    Linkedin
    Github
    Email
    Instagram
    ResearchGate
    知乎
    OSChina