As we all know, file copying on Linux has long relied on the classic cp command, which remains reliable but offers little feedback and limited control over long or complex operations.

To address this, a promising new Rust-based command-line tool called cpx emerge, designed as an alternative rather than a replacement, that approaches the same task with a focus on performance, visibility, and configurability.

It targets scenarios where large directory trees, interrupted transfers, or the need for detailed progress reporting make standard tools less convenient to use. The project is currently Linux-only and leverages modern kernel features to improve copy throughput and reliability.

  • tomenzgg@midwest.social
    link
    fedilink
    English
    arrow-up
    44
    arrow-down
    1
    ·
    18 hours ago

    New Linux util.

    looks inside

    Non-copyleft license

    I appreciate that it’s not trying to replace cp but the lack of copyleft is always disconcerting.

    • The_Decryptor@aussie.zone
      link
      fedilink
      English
      arrow-up
      6
      ·
      10 hours ago

      What’s the risk here though, a company like Amazon makes a closed source version of it?

      If it was a file format library, or something like a web server I’d get it. But stuff like cp are effectively just userspace wrappers around kernel APIs.

    • Badabinski@kbin.earth
      link
      fedilink
      arrow-up
      9
      ·
      17 hours ago

      yeah, like, supposedly it can be hard to use GPL with some rust dependencies, but the MPL is right there as a decent compromise.

      • HappyFrog@lemmy.blahaj.zone
        link
        fedilink
        arrow-up
        1
        ·
        7 hours ago

        I like and use rust, and I actively try to use permissive licenses for libraries and copy left for binaries. Just makes sense in my head.

        • Badabinski@kbin.earth
          link
          fedilink
          arrow-up
          4
          ·
          12 hours ago

          Static linking makes things difficult. I’m not sure what the details are, that’s just what I’ve heard from Rust developers.

          • The_Decryptor@aussie.zone
            link
            fedilink
            English
            arrow-up
            2
            ·
            10 hours ago

            Because of static linking, a single GPL dependency turns the entire resulting binary into a GPL licensed one, so yeah just use something like the MPL in that case (Or EUPL, which I hear is similar)

            LGPL has the same issue, since it only provides an exception for dynamic linking. But honestly that’s all an issue for lawyers and judges to sort out (I bet you could win in court with an argument that dynamically linking to GPL is actually fine).

    • sin_free_for_00_days@sopuli.xyz
      link
      fedilink
      English
      arrow-up
      3
      ·
      13 hours ago

      I’ve had cp aliased to rsync with my flags for years. It seems like a lot of newcomers try to “fix” stuff before they really understand what’s available. Or they just like to play around with different programming languages. Which is fine, but usually it’s not really interesting to me.

    • onlinepersona@programming.dev
      link
      fedilink
      arrow-up
      13
      arrow-down
      2
      ·
      19 hours ago

      It’s a damn pain to remember all the flags. How many flags can a program friggin have? I’m always afraid that some flag I enter will reverse the sync and delete everything in the source folder because the target is empty.

      I use rsync only when all params have been reseasrched and tested. cpx presumably just requires cpx - r source target instead of 5 rsync flags.

        • onlinepersona@programming.dev
          link
          fedilink
          arrow-up
          2
          ·
          edit-2
          11 hours ago

          I just looked it up and - x means one filesystem. But does - v give you a progress bar or just a lost of stuff copied?

          IIRC rsync also treats the trailing slash in a special manner that I always have to look up.

          • frongt@lemmy.zip
            link
            fedilink
            arrow-up
            2
            ·
            4 hours ago

            Ha. I meant z. I guess I was getting mixed up with tar.

            No slash means the directory. Slash means the items in the directory.

          • cyrl@lemmy.world
            link
            fedilink
            arrow-up
            2
            ·
            7 hours ago

            The trailing slash is just following cp’s own special treatment

            
            # before
            dir/
                file1
            target/
                orig.txt
            
            
            
            # no trailing slash - copy *dir* to target
            cp -r /path/to/some/dir /my/target
            
            # after
            target/
                orig.txt
                dir/            # dir copied to target
                    file1
            
            
            
            # with trailing slash - copy *contents* of dir to target
            cp -r /path/to/some/dir/ /my/target
            
            # after
            target/
                orig.txt
                file1            # contents of dir
            
            
      • Victor@lemmy.world
        link
        fedilink
        arrow-up
        7
        ·
        18 hours ago

        What 5 flags did rsync need? I always just do -av and go about my day. And the -v is kinda optional.