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?
When Atom installs it automatically creates a symlink in your /usr/local/bin. However in case it hasn't, you can create it yourself on your Mac
Now you can use
atom folder_name
to open a folder andatom file_name
to open a file. Hope this helps.In addition to @sbedulin (Greeting, lovely Windows users!)
The general path on Windows should be
If you are using a bash emulator like babun. You'd better checkout the shell files, which only available in the real app folders
Upgrading Atom appears to break command line functionality on the occasion. Looks like in my case it created two versions of the application instead of overwriting them. Occurs because the new file structure doesn't match file paths created by "Atom -> Install Shell Commands". In order fix the issue you'll need to do the following.
After that everything should work just like it did before. Hopefully this saves someone 30 minutes of poking around.
I had problems due to atom being unable to write its logfile when starting from the commandline. This cured it.
sudo chmod 777 ~/.atom/nohup.out
Iv'e noticed this recently with all new macs here at my office. Atom will be installed via an image for the developers but we found the Atom is never in the Application folder.
When doing a ls on the /usr/local/bin folder the path for atom will show something like "/private/var/folders/cs" . To resolve this, we just located atom.app and copied it into the application folder, then ran the system link commands provided by nwinkler which resoled the issue. Developers can now open atom from the command line with "atom" or open the current projects from their working director with "atom ."