Why does %cat work on Unix, but not Windows?

I teach a lot of Python courses using Jupyter, and as a Mac user, show them the contents of files using the %cat magic command. It would seem that %cat doesn’t exist or work on Windows. Now, I know that you could argue cat is a Unix command and thus doesn’t exist on Windows, but is there a reason this doesn’t work, when such Unixisms as %ls do work?

Where do the %cat and %ls magics come from in the first place? I don’t see them listed among the IPython magics: https://ipython.readthedocs.io/en/stable/interactive/magics.html

There’s an SO answer that suggests defining %cat as an alias: https://stackoverflow.com/a/32675775/5629418
That alias would then behave as if you had typed !cat, and ! is the magic for executing shell commands, which would explain the difference.

Aha! It never dawned on me that when you write %cat, Jupyter translates it and runs !cat. But that makes a heckuva lot of sense, and explains the difference.

I’m not about to ask my students to start with aliases, so I’ll see if there’s another good way to handle the show-a-file situation that’s cross platform.