I have the Atom editor and was wondering how you can open a file or folder from the terminal in Atom. I am using a Mac. I am looking for a way to do this:
atom . (opens folder)
atom file.js (opens file)
atom (opens editor)
Is this possible and how do I set it up?
For Windows 7 x64 with default Atom installation add this to your PATH
and restart any running consoles
(if you don't find Atom there - right-click Atom icon and navigate to Target)
The symlink solution for this stopped working for me in zsh today. I ended up creating an alias in my
.zshrc
file instead:alias atom='sh /Applications/Atom.app/Contents/Resources/app/atom.sh'
With conemu on windows 10 I couldn't call
atom
from console even after I added%USERPROFILE%\AppData\Local\atom\bin
to PATH in environment variables. I just addedto my
.bashrc
file.Another simple solution is to add /usr/local/bin to your PATH. I had the same issue, I installed shell commands (see shaheenery's response) the symlinks already existed and pointing to the correct destination (see thomax's response), however I would still get 'not found'. I'm using Korn Shell btw.
Here's what I did:
$ emacs ~/.kshrc
)export PATH="/usr/local/bin:${PATH}"
source ~/.profile
$ atom -h
Make sure to put (move) the atom into Application directory.
On macOS you can add it to your
~/.bash_profile
as
alias atom='open -a "Atom"'
and from terminal just call
atom filename.whatever