Skip to content

Feature request: cp/mv: implement advcpmv patches #174

Open

Description

@jeffangelion

While this doesn't making cp and mv 100% compatible with GNU variants, this progress bar functionality is very useful

Source: https://github.com/jarun/advcpmv

Activity

  1. medvednikov commented on Oct 4, 2024

    @medvednikov
    Member

    I agree

  2. JalonSolov commented on Oct 4, 2024

    @JalonSolov
    Contributor

    I could see adding a -progress option, or some such. So by default they worked like the coreutils versions, but would have the option of showing progress.

    Of course, I don't know that they collect all the info required up front to actually display the progress properly... seem like that would slow things down a bit, at least in some cases.

  3. metif12 commented on Oct 6, 2026

    @metif12
    Contributor

    Implemented in #230.

    Both tools take a --progress option, off by default, which draws a bar on
    standard error while the bytes move:

    $ cp --progress -r src dst
    [=============                           ] 33%
    [===============================         ] 77%
    [========================================] 100%
    

    The bar is forty columns wide with a percentage, drawn with a carriage return so
    each update overwrites the last. It is on stderr because that is where advcpmv
    draws, and because it keeps the tool's own stdout clean.

    The size of the source is stat'd before the first byte moves. That is what the bar
    needs in order to show a percentage, and it is why --progress is slower than a
    plain copy. The bar lives in common/progress.v so both tools share it.

    Two things worth knowing for anyone using it:

    • A long option with no short form is spelled with two dashes. cp -progress
      leaves it as a free argument and the copy fails; cp --progress works.
    • mv's directory move removes the source tree after copying, file by file,
      because rmdir only takes an empty directory.

    cp and mv had no test files before this, so both are new.

  4. added a commit that references this issue on Oct 27, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions