r/osx•
rajackson

I have a Unix command line book, will it work the same on OSX?

Posted May 28, 2019, 6:00 AM UTC

915
Tsiklon•

OS X’s unix tools are a broad mix of BSD and GNU tools, some may behave in the manner described in your book - others won’t.

If in doubt, use the man and info pages for your programs as reference - if you’re new to command line work understanding how to use the man pages is incredibly valuable, and strongly recommended.

16
StrangeCasiuss•

Mostly. Apples command line tools are a bit older than what you would find in your average linux distro and you may install 'Homebrew' or 'Macports' on your Mac to get more.

8
real_otternaut•

Linux isn‘t Unix/BSD/MacOS. so more of the Unix commands will work with Mac.

-7
StrangeCasiuss•

He asked about the command line. And to that my answer is correct.

I'm not here to have the ol' Linux/Unix convo.

8
real_otternaut•

Yes but the commands aren’t the same between MacOS/ bsd/Unix and Linux on the other hand. Or not?

-1
StrangeCasiuss•

Most of them are. Isnt that enough? And for all the things you might miss from the book, there certainly is a Brew or Macport.

6
[deleted]•

[deleted]

5
obimk1•

If they are "POSIX" compliant, most of the commands should work.

Most Terminal programs have a man function.

man ls

should provide in terminal an overview of the ls command and how to use it.

hth

3
SummerOftime•

macOS is a certified UNIX operating system, so yes.

3
crapusername47•

Almost. I have a bunch of scripts that I run on MacOS, on Cygwin on Windows and occasionally on Linux too.

There are a few places where I have to test what OS I’m using to pick the right command but that’s about it.

Oh, and there are also a few places where common tools line wget aren’t available so I had to build them myself.

2
hlaxfors•

It should be very similar

2
wowbagger•

What shell are they using? macOS these days uses bash shell by default, older UNIXen use others (cshell, kshell, etc.) so some of the syntax or feature of the shell might be different. When in doubt use the man(ual) pages in the Terminal for full syntax of specific commands. So if you want to know how the ps command works and what parameters it can take on macOS just enter man ps and hit enter in the Terminal.

2
macbalance•

Same-ish. Unix isn't a single unified standard (Well, it is, but...) and more of a mix of different flavors.

2
nroose•

Mostly. `man` pages will be more accurate. And google will help as well.

2
[deleted]•

[deleted]

2
[deleted]•

[removed]

1
pauldeb•

Sometimes.

0