New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Apps and Games Discussion of applications and games available for Mac OS X.

gedit command not found in Terminal


Post Reply New Thread Subscribe

 
Thread Tools
contardo

 
Member Since: May 27, 2011
Posts: 4
contardo is on a distinguished road

contardo is offline
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!
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,671
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
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
Personal Twitter
QUOTE Thanks
contardo

 
Member Since: May 27, 2011
Posts: 4
contardo is on a distinguished road

contardo is offline
Yes, that's where I downloaded it from.
But when I run the 'gedit' command in Terminal, it is not recognised.
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,671
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
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
Personal Twitter
QUOTE Thanks
contardo

 
Member Since: May 27, 2011
Posts: 4
contardo is on a distinguished road

contardo is offline
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.
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,624
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
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!
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,671
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
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
Personal Twitter
QUOTE Thanks
contardo

 
Member Since: May 27, 2011
Posts: 4
contardo is on a distinguished road

contardo is offline
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.
QUOTE Thanks
Dysfunction

 
Dysfunction's Avatar
 
Member Since: Mar 17, 2008
Location: Tucson, AZ
Posts: 6,624
Dysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant futureDysfunction has a brilliant future
Mac Specs: 2008 and 2011 15" mbps, late 11 iMac, iPhone 4s, and too many ipods and other stuff

Dysfunction is offline
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!
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,671
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
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
Personal Twitter
QUOTE Thanks
Helpful Googler

 
Member Since: Dec 21, 2011
Posts: 2
Helpful Googler is on a distinguished road

Helpful Googler is offline
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.
QUOTE Thanks
vansmith

 
vansmith's Avatar
 
Member Since: Oct 19, 2008
Location: Toronto
Posts: 17,671
vansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond reputevansmith has a reputation beyond repute
Mac Specs: 2012 13" MBP (2.5 i5, 8GB)

vansmith is offline
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
Personal Twitter
QUOTE Thanks
cradom

 
cradom's Avatar
 
Member Since: Feb 14, 2004
Location: Nederland, Texas
Posts: 2,896
cradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud ofcradom has much to be proud of
Mac Specs: 21in iMac core2 Duo- 13in macbook - 10.9 on both

cradom is offline
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)

Craig Domingue - resident redneck.
QUOTE Thanks
Helpful Googler

 
Member Since: Dec 21, 2011
Posts: 2
Helpful Googler is on a distinguished road

Helpful Googler is offline
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
QUOTE Thanks

Post Reply New Thread Subscribe


« Safari Not Loading Pictures. | Is there a way to automatically move mail from one folder to another? »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
How do you change default port for Terminal Services Client for Mac? vpalhories Internet, Networking, and Wireless 1 09-01-2010 01:27 PM
Terminal Won't Open icefall5 OS X - Operating System 7 08-25-2010 08:26 AM
Successfully removed the ACL found but not expected warnings in permissions repair 6string OS X - Operating System 1 09-25-2009 01:10 PM
My Terminal is messed up. edokid Switcher Hangout 8 11-16-2004 02:42 AM
Terminal nbizm 3 for the price of 1 Bo Eddy OS X - Development and Darwin 5 05-04-2004 12:40 PM

All times are GMT -4. The time now is 04:58 AM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?