Emacs gone from Mac OS Terminal - Only GUI version left [closed] - bash

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 6 years ago.
Improve this question
I have recently removed Emacs from my Mac OSX Yosemite, and have a beginner's beginner's problem in re-installing it and running it from the terminal. I can open the Emacs app GUI from the Applications folder, but cannot use Emacs from within the Terminal whatsoever.
I removed the old version of Emacs by using the command:
$ sudo rm /usr/bin/emacs
$ sudo rm -rf /usr/share/emacs
Then I installed the newest version of Emacs through Homebrew, using the code
$ brew install emacs --with-cocoa.
Now, when I type the command emacs in the terminal, I get "/usr/local/bin/emacs: No such file or directory."
I tried to add the following lines in a file named "emacs" in /usr/local/bin:
#!/bin/sh
/Applications/Emacs.app/Contents/MacOS/Emacs "$#"
But now, when I type the command emacs in the terminal I get: "-bash: /usr/local/bin/emacs: Permission denied"
Any suggestions? Thanks in advance!

My crystal ball tells me that you forgot to chmod +x /usr/local/bin/emacs.

You don't need a script, use a symbolic link.
$ ln -s /Applications/Emacs.app/Contents/MacOS/Emacs /usr/bin/emacs

Related

Export command not found on mac terminal [duplicate]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I added something to my bash_profile while trying to add Playframework to my path and something got messed up badly.
I added the following line to my .bash_profile
export PATH=$PATH:the path to my play excitable
then I saved everything and restarted my terminal. I can no longer do anything from my terminal. I can't cd into any directory, I can no longer find java, I can't open vi or nano.
I found this thread on SuperUser that suggested opening a different terminal and changing the bash profile.
I tried opening bash by typing
/bin/bash
and I was successfully able to open another terminal but I still don't have access to any of the regular unix commands. I still wasn't able to open vi or nano to remove the line that is causing the problem.
I tried downloading a new terminal application without any luck.
I tried turning on hidden files so that I can just change the file with a text editor by running the following command:
defaults write com.apple.finder AppleShowAllFiles TRUE
but since my terminal isn't working that didn't work either.
How can I fix my computer.
While this is offtopic for stackoverflow, it's also pretty simple to fix:
Start Terminal.app.
Reset $PATH:
$ export PATH=/bin:/usr/bin:/usr/local/bin
Fix ~/.bash_profile:
$ vi ~/.bash_profile
Or you can avoid setting $PATH at all with:
$ /usr/bin/vi ~/.bash_profile

Bash: mate : command not found [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
Hi I am learning how to use Github online via Udemy course. The instructor is accessing textmate editor using MAC OS. However I am trying to access textmate editor in Windows 10. When in Git bash I type
mate file_name.txt
It throws an error
bash: mate: command not found.
How can this be resolved. Any help will be appreciated.
Text Mate works only in MAC OS and not in Windows. Sublime Text is a good editor to work with in Windows:
Steps to open Sublime Text from Git bash (after installing Sublime text first in system) are as follows:
In Git bash(you can open from Search) type the below 2 commands:
alias subl="/c/Program\ Files/Sublime\ Text\ 3/sublime_text.exe"
subl .
Instead of subl . you can also open a specific file or create a new file using below:
subl Filename.txt
This command subl Filename.txt will create a new file with name as Filename.txt otherwise will open an existing file with the same name if the file already exists.

Creating `subl` alias does not actually work [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
After I upgraded Maverick, this all happened.
But my alias subl no longer works for Sublime Text Editor.
So I did this :
sudo ln -s "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl" /usr/bin/subl
Which successfully creates the executable in my /usr/bin/ folder where all my other executables are. However, even after restarting Terminal, it still does not respond to :
which subl
Or just :
subl
Your command
sudo ln -s "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl" /usr/bin/subl
has "/Applications/Sublime\ Text.app/Contents/SharedSupport/bin/subl" both in quotes and with an escaped space between Sublime and Text. Use one or the other.
So, first run
sudo rm /usr/bin/subl
to get rid of the old, incorrect symlink. Then, run
sudo ln -s "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl" /usr/bin/subl
(without the escape) and you should be all set.

How to restore .bash_profile on a mac? None of my unix terminal are working [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
I added something to my bash_profile while trying to add Playframework to my path and something got messed up badly.
I added the following line to my .bash_profile
export PATH=$PATH:the path to my play excitable
then I saved everything and restarted my terminal. I can no longer do anything from my terminal. I can't cd into any directory, I can no longer find java, I can't open vi or nano.
I found this thread on SuperUser that suggested opening a different terminal and changing the bash profile.
I tried opening bash by typing
/bin/bash
and I was successfully able to open another terminal but I still don't have access to any of the regular unix commands. I still wasn't able to open vi or nano to remove the line that is causing the problem.
I tried downloading a new terminal application without any luck.
I tried turning on hidden files so that I can just change the file with a text editor by running the following command:
defaults write com.apple.finder AppleShowAllFiles TRUE
but since my terminal isn't working that didn't work either.
How can I fix my computer.
While this is offtopic for stackoverflow, it's also pretty simple to fix:
Start Terminal.app.
Reset $PATH:
$ export PATH=/bin:/usr/bin:/usr/local/bin
Fix ~/.bash_profile:
$ vi ~/.bash_profile
Or you can avoid setting $PATH at all with:
$ /usr/bin/vi ~/.bash_profile

Can I gedit something in Mac's Terminal [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 9 years ago.
Improve this question
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.
Add
alias gedit="open -a gedit"
to ~/.bash_profile :
Now you'll be able to gedit directly from the command line.
try:
open -a /path/to/gedit /path/to/file.txt
I added the following to my PATH:
:~/Applications/gedit.app/Contents/MacOS/
and afterwards I was able to access gedit from
the command line. One caveat: if gedit is not already running on the system, then it throws an error if I launch it from the command line. Once gedit is already running though, this works to open files in gedit from the command line.
To edit the path, open ~/.profile in an editor
I use textmate for dev, here is a tutorial how it is done for Textmate
http://manual.macromates.com/en/using_textmate_from_terminal.html
I believe the same would apply to gedit.
Hope it helps

Resources