They both share their roots in Unix. Linux is an open port of Unix whereas OSX is a fork of BSD which is itself also derived from Unix
`ls`, `mv`, `cp` and other command line utility functions work relatively similarly across OSX and Linux. OSX has a package manager (brew) that works similarly to Package Managers found on Linux, etc...
If you learn to use Linux, switching to OSX is relatively painless compared to Windows (although WSL might have changed that)
Ah, I was expecting you to say something lower level than that. Homebrew is however quite unlike package managers I've used on Linux, and even MacPorts is a little different…I've heard that WSL is pretty decent and presumably APT works on it, though I haven't touched it since it first came out and it was broken in some way that I cared about.
You'll find that linuxbrew exists, apart from the AUR being a thing. And yes, apt and other distro package managers work perfectly fine in both wsl and wsl2.
Similar in what way?