If I have an instance of Atom open with some files already loaded, how can I open an additional file from the command line?

When I simply run:

atom filename.txt

It opens another instance of Atom (now two separate windows). How can I add the file as a new tab to the existing window?

Even better, what I would really like to do is Add Project Folder from the directory I'm currently in on the terminal console.

  • Try to run atom filename.txt --profile-startup false. Funny, but my atom is opening all files within same instance by default. What release is yours? Mine is Atom: 1.18.0/Electron: 1.3.15/Chrome : 52.0.2743.82/Node : 6.5.0 – Redbob Sep 29 '17 at 2:54
  • @Redbob please post that as an answer it works were I live :-) – George Udosen Sep 29 '17 at 5:32
  • 1
    I'm not sure that @George. Here at work, atom had same behavior and this parameter does not do the opposite if settled false. I think it's a misconfiguration at Jeff settings.. – Redbob Sep 29 '17 at 12:37
  • Jeff, rename ~/.atom folder or delete it, restart Atom and try it again. Let's see if works. – Redbob Sep 29 '17 at 12:39

As revealed by atom --help, you can use the -a/-add flag to open a file or folder in the last used window.


atom -a <filename>

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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