Hello,

[ quotations reordered ]

dan wrote on Sun, Aug 17, 2025 at 10:47:08AM +0200:

> I got to wonder about a sane move:
> mv source dest like a *macro* for cp + rm

   $ man -M /usr/share/man -s 1 -k '\<move\>'
  mv(1) - move files

   $ man mv
  [...]
  Should the rename(2) call fail because the source and destination are on
  different file systems, mv will imitate cp(1) and rm(1) to accomplish the
  move.  The effect is equivalent to:

    $ rm -df -- destination_path && \
       cp -PRp -- source destination_path && \
       rm -rf -- source

So unless i completely misunderstand what you are looking for,
this is more or less exactly it.

> Surely more safe than having partial files popping up here or there.

Not quite sure what you are trying to say here, but maybe something
like the CAVEATS in mv(1)?

> I'm not sure the topic is completely new..

Indeed.

   $ man mv | grep -A 1 ^H
  HISTORY
     A mv command appeared in Version 1 AT&T UNIX.

So it looks like your suggestion was implemented fifty-four years ago.

The Version 1 Unix manual listed Ken Thompson and Dennis M. Ritchie
as the code owners of the mv(1) program.

Please learn how to use the tools that come with the system.
Searching the manuals is not a bad startinmg point.

Yours,
  Ingo

Reply via email to