Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

When I want to edit a file from within a terminal window, the edit command is not recognised. I want it to open my editor (sublime text editor 2) and took the following steps:

Created a symbolic link on my path:

ln -s "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl" ~/bin/subl

specified it as my default editor:

export EDITOR='subl -w'

The command subl starts the editor up, so that worked fine. I can also see that the environment variable is set correctly.

But I stil get the "-bash: edit: command not found" error when trying to edit a file by entering edit ~/.bashrc for example.

share|improve this question
    
Setting the EDITOR environment variable will just cause other (Unix-y) programs, e.g. svn or git, that require some kind of editing, to launch Sublime Text 2 instead of e.g. vi. If you're following a tutorial or manual, you're probably confusing the Windows and OS X parts. –  Daniel Beck Aug 27 '12 at 9:16
    
When my collegues enter 'edit file.txt' it opens with a gui editor. When I do that I get the error as specified in the title. How do I make 'edit' open a gui text editor? –  P5ycH0 Aug 29 '12 at 12:40
    
You did the same thing but with subl. Just rename the link you created in the first command. –  Daniel Beck Aug 29 '12 at 12:53

1 Answer 1

up vote 0 down vote accepted

Edit is not a bash built-in command.

This means that the shell searches for a binary called edit in your PATH or an alias or a function called edit.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.