Few questions about OSX.

Discussion in 'macOS' started by linuxftw, Jun 25, 2007.

  1. linuxftw macrumors newbie

    Joined:
    Jun 25, 2007
    #1
    I considering switching from using linux as my main OS to using OSX. I have a few questions though.

    Firstly, is OSX able to run programs compiled for linux? (By programs I don't mean aplications like Microsoft Office, I mean things like sshd/ls/ssh/dd and so on)

    Second question, In linux you are able to set up partitions on a drive to mount to system directories, eg, you create a partition and set the mount point to /home, so when linux goes to save files to your home directory, it saves to the partition that mounts to /home, rather than the (root) partition all the OS files are in. My question, is it possible to do this in OSX? If so, how?

    Thirdly, I have herd that OSX can't write NTFS in finder and so on, is there a way around this, is it even true?

    Finally, in linux, config files are stored in /etc, I know there is a /etc folder on OSX, but im not sure about how much it is used, could somebody enlighten me?

    Thats it for now, thanks in advance :)
     
  2. hayduke macrumors 65816

    hayduke

    Joined:
    Mar 8, 2005
    Location:
    is a state of mind.
    #2
    The short answer is YES. The longer answer is that any software that is *compiled* on a Linux machine won't run on an OS X machine (the binary files are NOT compatible). All of the basic Linux/Unix commands are, however, pre-compiled and exist within OS X. If you open up a terminal you'll have access to all the goodies you are used to. You can also download code and/or binaries for numerous other Linux/Unix projects. Check out: http://finkproject.org/

    You can certainly partition the drives. It is a little tougher to do once the drive has the OS installed. The best option is to partition and then install the system, but there are hacks out there to partition afterwards as well. You can also create links (ln -s etc.) or use OS X aliases which (in my opinion) are quite as good as links. You can basically muck around as much as you can with Linux/Unix, but some might suggest that you just go with the flow and leave the basic file structuring/organization the same. Certainly this is true of system level files.

    Someone else will have to chime in on this one.

    It is in just the same way. It is used for all those glocbal Unix-y config-y kinds of things. You also still have .bash_profile files that are stored for each user etc.

    Hope this helps.
     
  3. eddietr macrumors 6502a

    Joined:
    Oct 29, 2006
    Location:
    Virginia
    #3
    MacPorts is another very nice package manager and source for many of the open source packages you are used to in linux.

    Once installed, you can do "port install <whatever>" and it works very nicely.

    But some of the ones you mentioned are actually part of the OS X distribution itself. No work necessary. For instance, to turn on sshd, just go to System Preferences->Sharing and enable "Remote Login". That's sshd. And of course ssh is there as well in /usr/bin/ssh

    As for NTFS, you are right you cannot write to that natively. However, you can via MacFUSE which is FUSE implementation for OS X. So then you can use FUSE drivers for things like sshfs and NTFS.
     
  4. plinden macrumors 68040

    plinden

    Joined:
    Apr 8, 2004
    #4
    A lot of open source programs can be compiled on OS X without needing any modifications (like most if not all the Apache programs) because the programmers have made the effort to add OS X to their configuration files.

    Others are ported using fink and Darwinports, but OS X already comes with the standard *nix command line utilities built from open source Darwin.

    I can't really answer your second question - I've just gone with the standard OS X. I never felt the need to partition the drive.

    Yes, it's true - just as it is true for standard Linux installs, but recently FUSE has become available on OS X, so in theory, it can support ntfs-3g, but I don't have an NTFS drive I need to access from OS X so I never tried it. But it does work with sshfs.

    Generally, applications that aren't directly ported (ie. those written specifically for OS X) write configuration files to /Library/Preferences or ~/Library/Preferences (yes, config files are in there, as well as user prefs), but I've seen some applications use /etc ... as well as many of the system level processes. I'm not at my Mac at the moment so I can't tell you anything specific.

    Although I use and muck around with Linux all day at work, I never really felt the need to play around with OS X in the same way. It does generally work just the way I want it, and I've adapted to the ways it does the rest.
     
  5. eddietr macrumors 6502a

    Joined:
    Oct 29, 2006
    Location:
    Virginia
    #5
    Things like ls, dd, tar, gunzip, vi and so on are of course already part of OS X. And some things you might not expect like emacs, python, ruby, apache httpd.
     
  6. Lixivial macrumors 6502a

    Lixivial

    Joined:
    Jan 13, 2005
    Location:
    Between cats, dogs and wanderlust.
    #6
    My answers will be mainly superficial here.

    1. Yes. MacPorts makes it somewhat easy to do this, and is similar in fashion (read: concept) as Synaptic. There are differences, such as MacPorts throws junk in /opt/local rather than /usr/local, but it works in generally the same way. Fink is another alternative. You'll find a good plenty of Linux CL apps already in OS X, including the ones you already mentioned. Leopard is to be fully POSIX-compliant, while Tiger is quite a ways there already.

    2. Um, well, this is indeed doable. User directories (/Users) can be rerouted using NetInfo Manager or its command-line interface. As for rerouting /etc, /usr, et al directories, I've never done this in OS X, so I'm not aware of it being done. It's likely that it can, but you may just as well save yourself the headache in not doing so. The swapfile can indeed be put onto a different partition with relative ease, but again I'm not going to recommend it one way or another.

    In this regard, Linux and OS X have a slightly different universe point of view.

    3. True. MacFUSE + NTFS-3G is the workaround for this. It works fairly well, but be prepared to jump into the command line to mount a "dirty" NTFS filesystem. (ignoring the obvious double-entendres here...)

    4. It's used in much the same way -- /etc is a link to /private/etc -- but many of the .conf files are used. There's one thing that may come around to bite you in the arse, though. A lot of the UNIX-derived utilities such as Apache (Personal Web Sharing), Samba (Windows Sharing), etc utilize .conf files. Many Mac OS X programs utilize an XML-derived plist file. Both are configuration/preference files.

    As a heads up, since you're moving from Linux, you'll want to get into the habit of learning about launchd (another good article), and launchctl as opposed to xinetd. If you're into launching daemons dynamically, you'll definitely want to read up on it, and might even wish to try a few GUI tools to generate the proper plist files. Lingon is one such tool. xinetd still exists in Tiger, but it's heavily recommended that you move across to utilizing launchd. I won't get into a debate over which is better, but Apple has clearly put its weight behind its homebrew (open source) project.

    I think you'll find that, at its heart, OS X isn't all that different from Linux.

    EDIT: Oh, uh, wow. A number of responses saying the same thing sprung in there while I was writing this. Kudos, mates. :)
     
  7. linuxftw thread starter macrumors newbie

    Joined:
    Jun 25, 2007
    #7
    Thanks for all the fast replies!

    This has definitely helped, good to know most of the unix/linux stuff is built into the OSX terminal by default :)

    Ill have a look into FUSE, as I need to be able to write to NTFS :)
     
  8. emptyCup macrumors 65816

    emptyCup

    Joined:
    Jan 5, 2005
    #8
    It's not exactly the same but you might like Mac OS X Tiger for Unix Geeks. Best wishes.
     

Share This Page