Results 1 to 12 of 12

Thread: mv -u ??

  1. #1
    mv -u ??
    xinelo's Avatar
    Member Since
    Jan 03, 2007
    Location
    Barcelona
    Posts
    24
    Specs:
    MacBook Intel 2 Core Duo
    mv -u ??
    Hello,

    <blabla>

    I started using a MacBook a week ago. Coming from the Linux world, initially I intended to erase the Mac OS X or keep it with a dual boot with Ubuntu but I was so impressed that I decided to give it a chance. I find it very beautiful, user-friendly and robust, but I still miss many things I can do in Linux but not in Mac.

    I'm surprised about that, I thought the command line part of the two operating systems would be more alike, although for many of them, after fiddling around a bit I usually find an alternative way to doing the same thing.

    </blabla> <the thing>

    However, yesterday I found that some basic commands, such as mv, don't work in the same way in the Mac OS X Terminal and in the Linux shell. Comparing the man pages for mv confirmed this. The update option (mv -u), for example, used to move only when the SOURCE file is newer than the destination file or when the destination file is missing, does not appear in the man mv for Mac OS X. In fact, from all the options that linux mv offers, only -f, -i, -n and -v are available in Mac.

    My question is twofold: Why is this? And what can I do to overcome this and have the same command line functionality as I had in linux?

    </the thing>

    Thanks for any reply you might want to give.
    xinelo

  2. #2
    mv -u ??
    ???'s Avatar
    Member Since
    Dec 25, 2006
    Location
    Japan
    Posts
    333
    Specs:
    MBP 2.0Ghz
    Well, why is this. Its simple, one is linux one isn't. As for the same functionality I don't know, but I am interested.

    I came from a linux world, but my intentions was to forget command lines as I wanted simplisty. I am going to play with the command lines and see what happens.

  3. #3
    mv -u ??
    rman's Avatar
    Member Since
    Dec 24, 2002
    Location
    Los Angeles, California
    Posts
    12,584
    Specs:
    2 x 3.0GHz Quad-Core, 6GB OS X 10.6.8 | 15in MacBook Pro 2.2GHz OS X 10.6.8 | 64GB iPad 2 WiFi
    Cool
    That is just one of the many things that are different with each flavor of unix. Not all commands work the same way, in each version of unix.
    Life isn't about waiting for the storm to pass, It's about learning to dance in the rain!

  4. #4
    mv -u ??
    caribiner23's Avatar
    Member Since
    Feb 06, 2005
    Location
    Chicago
    Posts
    1,543
    Specs:
    MacBook Pro Retina 13" • iPhone 6 • iPad Air • and many iPods
    The neat thing for me is that I came from the Sun Microsystems and NeXT worlds, so the shell and command line are waaaaaay familiar to me.

    And it's worth noting that Linux and UNIX are not the same operating system. Unices differ among distributions, as to Linuces.

    I found this neat little graphic on Wikipedia that illustrates the lineage of the various flavors of UNIX.

  5. #5
    MacHeadCase
    Guest
    Quote Originally Posted by caribiner23 View Post
    The neat thing for me is that I came from the Sun Microsystems and NeXT worlds, so the shell and command line are waaaaaay familiar to me.

    *Snip*
    [Off Topic]

    I would imagine you know RacerX (David Shaw) then, caribiner23?

    [/Off Topic]

  6. #6
    mv -u ??
    xinelo's Avatar
    Member Since
    Jan 03, 2007
    Location
    Barcelona
    Posts
    24
    Specs:
    MacBook Intel 2 Core Duo
    Thanks, everyone, for your answers. xinelo

  7. #7
    mv -u ??
    novicew's Avatar
    Member Since
    Jan 04, 2006
    Location
    Hamburg, Germany
    Posts
    1,385
    Specs:
    MacBook Pro | iMac(2.1 G5) | MacBook(2.16 C2D) | MacMini (1.67 CD) | iPhone 4 | iPad (3rd Gen)
    If you are interested in using native linux commands in OS X try Darwin Port or Fink(my choice). The Open Source community ported many Linux apps. to run in X11 just as you would do in any Linux distro. You can even install Gnome, KDE, etc on top of X11, if you like.

  8. #8
    mv -u ??
    cazabam's Avatar
    Member Since
    Jun 06, 2006
    Posts
    1,153
    Specs:
    MacBook 2.0GHz White, 512MB RAM, 60GB HDD
    The thing is, the Mac OS X command line utilities are the same as the ones in the various BSDs and (I think) stuff like Solaris. Linux is, in fact, the odd one out. The BSD implementations that are used by OS X (Darwin), FreeBSD, NetBSD, OpenBSD et al are slightly different from the GNU ones that pretty much universally have Linux as the kernel.

  9. #9
    mv -u ??
    caribiner23's Avatar
    Member Since
    Feb 06, 2005
    Location
    Chicago
    Posts
    1,543
    Specs:
    MacBook Pro Retina 13" • iPhone 6 • iPad Air • and many iPods
    Quote Originally Posted by MacHeadCase View Post
    [Off Topic]

    I would imagine you know RacerX (David Shaw) then, caribiner23?

    [/Off Topic]

    Only if he was on one of the boat trips NeXT used to sponsor for their customers... :-)

    OS X's command line shell is a lot like NeXTStep's, and no surprise there.

    It's also similar to SunOS (pre-Solaris) and DEC UNIX (which became OSF/1) which are both pretty close to "pure" BSD.

  10. #10
    mv -u ??
    mac57's Avatar
    Member Since
    Apr 29, 2006
    Location
    St. Somewhere
    Posts
    4,560
    Specs:
    iMac 27" 3.4 GHz, 256 GB SSD, 2 TB HDD, 8 GB RAM
    As is pointed out above, Mac's Terminal shell is based on FreeBSD. This is not the same as Linux, although close. Happily, the usual "man" command works just fine, so you can always check out the options for your favorite commands such as "rm" before you try them. You can also find the man pages for FreeBSD available on the web to help you.
    My Macs: iMac 27" 3.4 GHz, Mac Pro 3.2 GHz, PowerMac G5 Quad 2.5 GHz, G4 Cube with 1.2 GHz Upgrade
    My iStuff: 64GB iPhone 5, 64GB iPad4, 30GB iPod Video, 16GB iPod Touch
    My OS': Mac OS X Lion, Mac OS X Snow Leopard, Mac OS X Tiger, Mac OS 9.2.2, openSUSE 10.3
    I was on the Mac-Forums honor roll for September 2007

  11. #11
    mv -u ??
    xinelo's Avatar
    Member Since
    Jan 03, 2007
    Location
    Barcelona
    Posts
    24
    Specs:
    MacBook Intel 2 Core Duo
    Thanks.

    So I suppose it's a question of either getting used to the BSD command style and learning to do things differently or installing Fink (and X11). However, what exactly would be the application to install with Fink to get the Linux commands?

    Is there a way to run applications through Fink in Aqua (withough installing X11)?

    I was aware Darwin is based on BSD unix but didn't expect this kind of differences. I thought all the *nix varieites were quite alike in this regard. I've been a Linux user for a couple of years with occasional contact with a unix console (via putty) or with ksh but had never realized any command worked differently. I had not used any BSD system, though.

    Thanks a lot for your help! xinelo

  12. #12
    mv -u ??
    mac57's Avatar
    Member Since
    Apr 29, 2006
    Location
    St. Somewhere
    Posts
    4,560
    Specs:
    iMac 27" 3.4 GHz, 256 GB SSD, 2 TB HDD, 8 GB RAM
    I have installed a full set of open source apps on my Mac using DarwinPorts. Irrespective of Fink vs. Darwin ports, you should be able to go to your favorite Linux system and use its package manager to find the package name that contains the really basic stuff like ls, rm, cp, etc. Install that package (I don't have my Linux system up and running, so I am not sure what it is) via Fink. In pretty much all Linux systems I have seen, that package has the same name - I just can't remember what it is!

    Then you will have to modify your .bashrc to change your PATH so that bash scans your Fink bin collection before /bin, which has the default Mac stuff in it.
    My Macs: iMac 27" 3.4 GHz, Mac Pro 3.2 GHz, PowerMac G5 Quad 2.5 GHz, G4 Cube with 1.2 GHz Upgrade
    My iStuff: 64GB iPhone 5, 64GB iPad4, 30GB iPod Video, 16GB iPod Touch
    My OS': Mac OS X Lion, Mac OS X Snow Leopard, Mac OS X Tiger, Mac OS 9.2.2, openSUSE 10.3
    I was on the Mac-Forums honor roll for September 2007

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •