mv -u ??

Joined
Jan 3, 2007
Messages
24
Reaction score
1
Points
3
Location
Barcelona
Your Mac's Specs
MacBook Intel 2 Core Duo
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
 

???


Joined
Dec 25, 2006
Messages
333
Reaction score
3
Points
18
Location
Japan
Your Mac's 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.
 

rman


Retired Staff
Joined
Dec 24, 2002
Messages
12,637
Reaction score
168
Points
63
Location
Los Angeles, California
Your Mac's Specs
14in MacBook Pro M1 Max 32GB 2TB
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.
 
Joined
Feb 6, 2005
Messages
1,551
Reaction score
102
Points
63
Location
Chicago
Your Mac's Specs
MacBook Pro M1 • iPhone 14 Pro • iPad Pro • iMac Retina 27"
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.
 
M

MacHeadCase

Guest
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]
 
OP
xinelo
Joined
Jan 3, 2007
Messages
24
Reaction score
1
Points
3
Location
Barcelona
Your Mac's Specs
MacBook Intel 2 Core Duo
Thanks, everyone, for your answers. xinelo
 
Joined
Jan 4, 2006
Messages
1,385
Reaction score
146
Points
63
Location
Hamburg, Germany
Your Mac's 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.
 
Joined
Jun 6, 2006
Messages
1,153
Reaction score
94
Points
48
Your Mac's 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.
 
Joined
Feb 6, 2005
Messages
1,551
Reaction score
102
Points
63
Location
Chicago
Your Mac's Specs
MacBook Pro M1 • iPhone 14 Pro • iPad Pro • iMac Retina 27"
[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.
 
Joined
Apr 29, 2006
Messages
4,576
Reaction score
378
Points
83
Location
St. Somewhere
Your Mac's Specs
Mac Studio, M1 Max, 32 GB RAM, 2 TB SSD
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.
 
OP
xinelo
Joined
Jan 3, 2007
Messages
24
Reaction score
1
Points
3
Location
Barcelona
Your Mac's 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
 
Joined
Apr 29, 2006
Messages
4,576
Reaction score
378
Points
83
Location
St. Somewhere
Your Mac's Specs
Mac Studio, M1 Max, 32 GB RAM, 2 TB SSD
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.
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top