So far, when I was working in Linux, I would open my Mathematica files from the terminal by typing:

mathematica filename.nb &

But now, I got a mac, and when I try it says

-bash: mathematica: command not found

So, I have to open the Mathematica files by going to Finder and double clicking the file in a Finder window, which is annoying!

I tried to google it, and I expected that it would be easy to find info about it, but I did not find any.

Can anybody help me?


You might give this a try:

open filename.nb
  • $\begingroup$ indeed, it works :)))! Thankyou zoo much!! $\endgroup$
    – Mencia
    Jun 14 '14 at 19:13
  • 1
    $\begingroup$ And for reference, if that doesn't work, try: open -a Mathematica filename.nb. $\endgroup$
    – C. E.
    Jun 14 '14 at 19:18
  • $\begingroup$ And how can I open a new notebook, i.e. not an already existing file from the terminal? In Linux it would be just "mathematica &" $\endgroup$
    – Mencia
    Jun 14 '14 at 19:24
  • 1
    $\begingroup$ @Mencia open -a Mathematica $\endgroup$
    – Michael E2
    Jun 14 '14 at 19:59
  • 1
    $\begingroup$ @Mencia open -n -a Mathematica opens a new instance of Mathematica. touch ${TMPDIR}/new.nb; open -a Mathematica ${TMPDIR}/new.nb creates a new file in a temporary folder and then opens it. Since the file is created inside the temporary directory it will be removed when the system is restarted. I think the equivalent to what you're talking about is the first option, but it opens the splash screen instead of a blank notebook. $\endgroup$
    – C. E.
    Jun 14 '14 at 20:16

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.