Unix/Linux question...

Posted:
in macOS edited January 2014
Does anyone user their Mac to study Unix or Linux???



I want to add Unix and or Linux as a skill set but don't know where to start...

Comments

  • Reply 1 of 17
    pbpb Posts: 4,255member
    Quote:

    Originally posted by O-Mac

    Does anyone user their Mac to study Unix or Linux???



    I want to add Unix and or Linux as a skill set but don't know where to start...




    Mac OS X is Unix (from the BSD family), unless you chose to left out the BSD layer during installation. As for Linux, the last time I bothered with installations on Macs was in the OS 9 days. I don't know how are things today. Others here may help you more on that.
  • Reply 2 of 17
    OSX is essentially Unix/Linux. I mean, they work pretty much the same under the hood. There are differences as far as file system and where system files are, but that is true across most Unix and Linux distributions.



    In your utilities folder in the application folder, there is your terminal program. This gives you command line access to the OS. If you type in 'man cron' or man followed by the command you want directions for. Your screen will be filled with info about that command, along with examples.



    http://www.ss64.com/osx/ is a list of osx specific commands, but almost all Unix command work. If you are unsure see if there is a manual for that command in OSX, by using the 'man' command.



    There are any number unix resources on the web. There is even a dashboard widget that has a complete Unix manual for all commands.



    Jump right in, just read those man pages carefully so as to not screw anything up. Something like 'chmod -r 777 /library/webserver/documents' instead of 'chmod -R 777 /library/webserver/documents' can screw you up big-time.



    Remember too, instead of typing whole paths, drag a file or folder into the terminal window, and bam!, it is entered for you. Apple + C and Apple + V works inside the terminal also.



    It's no harder than learning DOS, IMO.



    Have fun.
  • Reply 3 of 17
    Quote:

    Originally posted by MachOneFL

    OSX is essentially Unix/Linux. I mean, they work pretty much the same under the hood. There are differences as far as file system and where system files are, but that is true across most Unix and Linux distributions.



    OS X is a cross between Unix and BSD. It has nothing to do with the Linux kernel.
  • Reply 4 of 17
    1337_5l4xx0r1337_5l4xx0r Posts: 1,558member
    There are a plethora of free liux distros for Macs. I've used gentoo, but ubuntu has all the buzz these days. Give them a shot. Linux is pretty cool.
  • Reply 5 of 17
    ngmapplengmapple Posts: 117member
    Sure, you can use Mac OS X to learn the BASH sh shell, which is about 80-90% of what you'll need to know to consider yourself a Linux/Unix user. Pickup a generic linux or Bash book and see what works and what doesn't in the Mac OS X shell. You'll find a lot of the same utilities and root user control in Mac OS X is very similar to Debian linux. Keep in mind the kernel in OS X/Darwin/BSD is a little different from Linux, but that will only really affect you if you dig down deep.



    The one thing that you won't get much Linux/UNIX experience in in Mac OS X is package management. This is the one feature that Tiger lacks and really needs that Linux usually has. Let's hope we see it in Leopard.
  • Reply 6 of 17
    mdriftmeyermdriftmeyer Posts: 7,503member
    Quote:

    Originally posted by gregmightdothat

    OS X is a cross between Unix and BSD. It has nothing to do with the Linux kernel.



    Oh get over yourself. OS X is the XNU Kernel and Linux is the Linux Kernel. The BSD Layer is above the XNU Kernel. The ext3, reiser4/FS, xfs, etc Layer is above the Linux Kernel.



    The BSD Utils of FreeBSD are in all Linux Distros. Some of Linux tools have been ported to the BSDs, etc.



    Bash is Bash. Bash 3 is what I use in Debian Sid and OS X Tiger.



    CUPS is standard in Linux and standard in OS X.



    There are many cross over low level aspects of both platforms that make them compatible, at those levels.
  • Reply 7 of 17
    chuckerchucker Posts: 5,089member
    Quote:

    Originally posted by mdriftmeyer

    The ext3, reiser4/FS, xfs, etc Layer is above the Linux Kernel.



    Not entirely true. Much of ext3 (journaling support, for instance) is implemented right in the kernel.



    Quote:

    The BSD Utils of FreeBSD are in all Linux Distros.



    No, most Linux distros come with the GNU userland instead.



    Quote:

    There are many cross over low level aspects of both platforms that make them compatible, at those levels.



    Yes, true.
  • Reply 8 of 17
    nerudaneruda Posts: 439member
    Quote:

    Originally posted by O-Mac

    Does anyone user their Mac to study Unix or Linux???



    I want to add Unix and or Linux as a skill set but don't know where to start...




    [sidestepping the inevitable "linux vs. os x vs. bsd/ what is a real unix tangent. Up next, the bash vs. korn shell flame war ]



    Open Applications>Utilities>Terminal and play around with the Unix commands. I usually use the terminal to kill applications because it does it almost instantaneously (as opposed to the force quit command).



    The man pages contain some instructions on the commands. For example, to get a list of options available to the top command, type "man top" (no quotes)in the terminal. Top gives you a list of the top processes that are running (ie "top 10" displays the top ten). I get the process id of the app that is frozen, then either use the kill or killall command to kill it (ie kill 13290).



    Get Fink and X11 for OSS apps.



    www.osxfaq.com has more advanced tutorials.



    Unix Power Tools is one of the best Unix books that I have read and I highly recommend it. O'Reilly has a lot of books on OS X's Unix roots.

    http://www.oreilly.com/catalog/mosxgeeks/



    The command line is great once you start to learn how to use it.
  • Reply 9 of 17
    MarvinMarvin Posts: 15,322moderator
    Quote:

    Originally posted by Neruda

    Top gives you a list of the top processes that are running (ie "top 10" displays the top ten). I get the process id of the app that is frozen, then either use the kill or killall command to kill it (ie kill 13290).



    Get Fink and X11 for OSS apps.




    I don't like top at all. It cuts off most of my processes. I use the Activity Monitor to check PID now. Maybe Leopard should have a feature where it shows the PID in brackets after the name in the dock. Of course it would have to be an option so newbies don't cry that there are weird numbers after names.



    I actually just kill apps by alt-right-clicking their names and force quit. It seems to work pretty fast most of the time.



    Fink and X11 are not very good either. X11 is very slow and there are hardly any decent programs to run under it. GIMP is ok but when you can get PS Elements dirt cheap with lots of vector brushes and full tablet support, there's no need to suffer. The only program I like is Inkscape but again, it's slow.



    I'd like to see a more integrated X11 in Leopard. It looks like an emulator the way it is now. Either that or an easy way to port them into Cocoa.



    Anyway, I think OS X is a good way to learn unix but not Linux. They are not synonymous. The whole packaging systems are dependent on the different Linux distributions anyway so they're not really standard. OS X is a blend of NeXT and BSD so you get some of both but it's a full unix system and has everything you'd expect where you'd expect. There are very few unix tutorials that I couldn't apply to OS X.
  • Reply 10 of 17
    There's a Unix book I remember, and it not only covered generl unix, but also Linux and OS X varieties. I'll have to look up the title, though.
  • Reply 11 of 17
    nerudaneruda Posts: 439member
    Quote:

    Originally posted by Marvin

    I don't like top at all. It cuts off most of my processes.



    Then use ps -aux (or combinations thereof)



    Quote:

    I use the Activity Monitor to check PID now.

    I actually just kill apps by alt-right-clicking their names and force quit. It seems to work pretty fast most of the time.




    The more I lean to use the Terminal, the less I use its graphical equivalent (activity monitor). Again, from my experience, I prefer killing an app from the terminal since it is almost instantaneous (not so with force quit).



    Quote:

    I'd like to see a more integrated X11 in Leopard. It looks like an emulator the way it is now. Either that or an easy way to port them into Cocoa.



    This would be nice. Let's hope Apple moves in this direction.



    Quote:

    Anyway, I think OS X is a good way to learn unix but not Linux. They are not synonymous.



    Of course they aren't, but a large number of commands are similar if not exactly the same.
  • Reply 12 of 17
    trobertstroberts Posts: 702member
    I have Tiger dual-booting with OpenBSD 3.9, but I really wanted FreeBSD. Problem is GNUstep supports FreeBSD but FreeBSD does not support my iBook where OpenBSD supports my iBook but GNUstep does not support OpenBSD. After looking at OpenBSD and seeing what packages and ports are available I decided to install it.



    From what I have learned, OpenBSD is not worried about compiling the kernel and apps so they are "optimised" for whatever system is running them. Not only is it suggested you use the OS as it is, but when installing apps you should install the packages (pre-compiled binaries) instead of compiling ports (source code, I think).
  • Reply 13 of 17
    mdriftmeyermdriftmeyer Posts: 7,503member
    Quote:

    Originally posted by Chucker

    Not entirely true. Much of ext3 (journaling support, for instance) is implemented right in the kernel.







    No, most Linux distros come with the GNU userland instead.







    Yes, true.




    On the userland: the RPM or DEB or whatever package format your Linux distribution utilizes all of the distributions include the BSD Utils as a simple select and install.



    Actually, all the filesystems are module enabled or disabled or built-in support so the kernel doesn't hardware ext3 into the kernel. It's an option. In fact, I've got ext3 journaling compiled as a module.
  • Reply 14 of 17
    chuckerchucker Posts: 5,089member
    Quote:

    Originally posted by mdriftmeyer

    On the userland: the RPM or DEB or whatever package format your Linux distribution utilizes all of the distributions include the BSD Utils as a simple select and install.



    The bulk of the userland on virtually all Linux distribution is GNU-based, RPM, Deb or whatever.



    Quote:

    Actually, all the filesystems are module enabled or disabled or built-in support so the kernel doesn't hardware ext3 into the kernel. It's an option. In fact, I've got ext3 journaling compiled as a module.



    Um. And? That doesn't make my point untrue. ext3 as implemented in Linux is inherently kernel-bound.
  • Reply 15 of 17
    Quote:

    Originally posted by mdriftmeyer

    Oh get over yourself. OS X is the XNU Kernel and Linux is the Linux Kernel. The BSD Layer is above the XNU Kernel. The ext3, reiser4/FS, xfs, etc Layer is above the Linux Kernel.



    The BSD Utils of FreeBSD are in all Linux Distros. Some of Linux tools have been ported to the BSDs, etc.



    Bash is Bash. Bash 3 is what I use in Debian Sid and OS X Tiger.



    CUPS is standard in Linux and standard in OS X.



    There are many cross over low level aspects of both platforms that make them compatible, at those levels.




    Um, wtf? Get over myself?
  • Reply 16 of 17
    Here's something to remember too. Apple's filesystem is case insensitive while most unix filesystems are case sensitive.
  • Reply 17 of 17
    splinemodelsplinemodel Posts: 7,311member
    Quote:

    Originally posted by O-Mac

    Does anyone user their Mac to study Unix or Linux???



    I want to add Unix and or Linux as a skill set but don't know where to start...




    To answer your question (avoiding all the clashing above), yes.



    As necessity is the mother of invention, and possibly also the mother of exploration, installing Linux and configuring it is probably the best way to get "the feel." However, you can avoid all the fuss and still use most of the command line utilities with Mac OS X.



    If you really want to get the feel for unix/linux, buy a gumstix and install the toolchain on your mac.
Sign In or Register to comment.