Results 1 to 14 of 14
  1. #1


    Member Since
    May 27, 2011
    Posts
    4
    gedit command not found in Terminal
    Hi,
    I'm not sure if this is in the right place, so mods feel free to move it to the relevant subforum.

    I am trying to set up gedit on my Mac, but the gedit command in the Terminal is not recognised.
    I have downloaded gedit (and gfortran) so what should I do next?

    Any advice appreciated.
    I should also say that I'm relatively new to using Terminal, so feel free to break down any instructions!

  2. #2

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    Moved to a more appropriate forum.

    No need to download the source and compile the code (I can imagine that getting all the dependencies working together would be a pain unless you used a package manager) - you can get gedit here as a precompiled binary (see link on the right hand side).
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  3. #3


    Member Since
    May 27, 2011
    Posts
    4
    Yes, that's where I downloaded it from.
    But when I run the 'gedit' command in Terminal, it is not recognised.

  4. #4

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    No need to run it from the command line - it's a regular application bundle. Just double click it, after you've dragged it out the dmg, and it should run.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  5. #5


    Member Since
    May 27, 2011
    Posts
    4
    I can open it from its icon no problem, but if I'm working on compiling programmes in the Terminal, it would be handy to be able to use it to open files using gedit.

  6. #6

    Dysfunction's Avatar
    Member Since
    Mar 17, 2008
    Location
    Tucson, AZ
    Posts
    6,881
    Specs:
    Way... way too many specs to list.
    Try specifying it's path. If that works, add it to your $PATH. That should work, else then you could use open. Personally, I just use vi because I'm lazy.. and it's on every system out there.


    Actually, since it's a gui application use this.


    open <filename>

    That will open to the registered application. Or you could do..

    open -a /path/to/gedit <filename>
    mike
    This machine kills fascists
    Got # ? phear the command line!

  7. #7

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    One thing to note about the open command: if you use the -a switch, open assumes you're referring to an application in the /Applications folder (it may check user application folders too but I'm not sure) so you won't have to provide the full path if that's where it is. If it's not in the /Applications folder, you'll need to provide the full path as noted by Dysfunction.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  8. #8


    Member Since
    May 27, 2011
    Posts
    4
    Okay thanks - the open command works fine - that should do.
    And the other editors as well - I'm not particularly fussy about which one I use because I don't understand the differences between them yet, being a relative beginner, but gedit is the only one I have used before.

    One final thing - what's the best/most efficient way to compile programmes? Is there a compiler built in to my Mac?
    I have downloaded gfortran and I have found the g++ commands in a folder in the / directory, but I don't know how to make that command be recognised in my home directory where I'll be working. Any advice on that?

    Thank you.

  9. #9

    Dysfunction's Avatar
    Member Since
    Mar 17, 2008
    Location
    Tucson, AZ
    Posts
    6,881
    Specs:
    Way... way too many specs to list.
    While the gcc compiler isn't built into the OS out of the box, it is included in Xcode (which is a full IDE as well). This should be on one of the two disks that were supplied with the machine, or you can download it from Apple (there's a 3.x version that is free and a 4.x version which is $5). The former is available from their developers site (you need to register, it's free) and the latter is available on the app store.

    Now, to be able to run a command in Unix in general it either needs to be in your path or you'd need to run the full path.
    mike
    This machine kills fascists
    Got # ? phear the command line!

  10. #10

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    If you're not picky about editors, you might be better served by a native Mac editor. gedit inherits some of the idiosyncrasies of GTK that appear when using it in OS X. There are lots available so I'll let you decide which one you want to use but I would suggest that you look around.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  11. #11


    Member Since
    Dec 21, 2011
    Posts
    2
    This is the top result for "gedit mac terminal".

    The answer in this thread for what OP asked isn't very clear.

    If you've already installed the Mac gedit Application from the dmg here is how you get it to work in terminal.

    1. In terminal, sudo nano [or other text editor] /etc/paths.
    2. Add /Applications/gedit.app/Contents/MacOS/ to the list. (This points to where the gedit binary is.)
    3. Save paths file (in nano this is ctrl-o).
    4. Reload terminal.

  12. #12

    vansmith's Avatar
    Member Since
    Oct 19, 2008
    Location
    Toronto
    Posts
    19,782
    Specs:
    2012 13" MBP (2.5 i5, 8GB)
    Quote Originally Posted by Helpful Googler View Post
    The answer in this thread for what OP asked isn't very clear.
    Quote Originally Posted by Dysfunction View Post
    Try specifying it's path. If that works, add it to your $PATH. [...] open <filename>

    That will open to the registered application. Or you could do..

    open -a /path/to/gedit <filename>
    Quote Originally Posted by contardo View Post
    Okay thanks - the open command works fine - that should do.
    Evidently it does.

    Your solution would work if you wanted to add the gedit command permanently to the PATH but it's not required.
    Important Links: Community Guidelines : Use the reputation system if you've been helped.
    M-F Blog :: Write for the blog
    Writing a Quality Post

  13. #13

    cradom's Avatar
    Member Since
    Feb 14, 2004
    Location
    Groves, Texas
    Posts
    4,611
    Specs:
    21in. iMac 10.11 --- HP Linux Mint 18
    For the record it's not a good idea to edit anything in /etc. The best way to do this is copy the bashrc file in /etc to your home dir and edit it.
    Then rename it to .bashrc (notice the dot in front).

    Editing directly in /etc makes changes for ALL users which may not be a good thing. (not to mention that you don't own the files, system does)
    One manís theology is another manís belly laugh.
    -Lazarus Long

  14. #14


    Member Since
    Dec 21, 2011
    Posts
    2
    Quote Originally Posted by vansmith View Post
    Evidently it does.

    Your solution would work if you wanted to add the gedit command permanently to the PATH but it's not required.
    That's not what I or anyone else finding this page wants.

    I want to simply enter "gedit" and get gedit like you would in Linux. open doesn't do that.

    Sure you can set up an alias, edit the .bashrc, etc., but no one actually explained step-by-step how to do that and I wanted to put an easy solution on this page for anyone who stumbles upon this in the future.

    - Helpful Googler

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. htpasswd: command not found
    By ecarter202 in forum OS X - Operating System
    Replies: 10
    Last Post: 07-30-2014, 06:54 PM
  2. Command Not Found Pblm im Mac Terminal
    By tizeliza in forum Switcher Hangout
    Replies: 1
    Last Post: 09-05-2013, 05:18 PM
  3. -bash g++:command not found
    By Brightsun in forum OS X - Development and Darwin
    Replies: 4
    Last Post: 04-22-2012, 10:20 AM
  4. GCC_Select: command not found?
    By symantec11_76 in forum OS X - Development and Darwin
    Replies: 0
    Last Post: 12-05-2008, 02:42 PM
  5. Using cc in darwin: command not found.
    By olav in forum OS X - Development and Darwin
    Replies: 2
    Last Post: 03-28-2006, 04:31 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •