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.

all 44 comments

sorted by: hot top controversial new old
[–] 61 points 9 months ago (9 children)

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.

  • source
  • hideshow 9 child comments
  • [–] 12 points 9 months ago (7 children)

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

  • source
  • parent
  • hideshow 7 child comments
  • [–] 8 points 9 months ago (2 children)

    how can it be hard? permissive licenses are compatible to the GPL, the opposite not though

  • source
  • parent
  • hideshow 2 child comments
  • [–] 4 points 9 months ago (1 child)

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

  • source
  • parent
  • hideshow 1 child comment
  • [–] 3 points 9 months 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).

  • source
  • parent
  • [–] 2 points 9 months ago (3 children)

    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.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 2 points 9 months ago (2 children)

    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.

    I always find choosing a license confusing.

    If you're up for it, I would love to read why you use this guideline.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 2 points 9 months ago (1 child)

    I want people to use the software I write, and people don't want dependencies in their projects that are gpl because you either need to change your project to gpl or go through a very tedious process of providing object files for the entire project. That's why I use mit for libraries.

    However, I don't want to allow companies to just take my finished binaries and resell them as their services, so I use GPL for binaries and apps. They are free to reimplement the app using the libraries, but I at least want them to work for it a little.

    Also, I have found it easier to get contributions to projects that are licensed under mit than gpl, though this might just be insufficient sample size.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 9 points 9 months 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.

  • source
  • parent
  • [–] 21 points 9 months ago (17 children)
  • [–] 15 points 9 months ago (9 children)

    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.

  • source
  • parent
  • hideshow 9 child comments
  • [–] 7 points 9 months ago (2 children)

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

  • source
  • parent
  • hideshow 2 child comments
  • [–] 11 points 9 months ago* (last edited 9 months ago) (4 children)

    The only one you need is -a. -avz if you want verbose and compression.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 3 points 9 months ago* (2 children)

    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.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 4 points 9 months 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
    
    
  • source
  • parent
  • [–] 3 points 9 months ago (3 children)

    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.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 0 points 9 months ago (2 children)

    you seem to have added a condescending comment before you understood the goals. 2-5x speedup over rsync (their benchmarks, but still) seems significant on its own, and an interface that doesn't require aliasing to be useful is also nice

  • source
  • parent
  • hideshow 2 child comments
  • [–] 0 points 9 months ago (1 child)

    Nope, thanks for projecting though. I just didn't mention the multi-threaded because, again, it doesn't speed up anything. Transfer speed has always been the bottleneck, unless you're talking about heavy data-center type use. Like I said, if it's interesting to you, go for it. I don't see a need to reinvent the wheel on core utilities.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 13 points 9 months ago (11 children)

    eza fd-find

    Which other modernized tools to get and enjoy fam?

  • source
  • hideshow 11 child comments
  • [–] 23 points 9 months ago (8 children)

    So many things from the Modern UNIX tools repo!

    My daily drivers are: lsd instead of ls - colors, icons, tree-view, more formatting, dust instead of du for better formatting, jq for viewing JSON, gtop instead of top just because it's so pretty

    image

    (I've aliased most of these, but there are a few toolchains that have broken)

  • source
  • parent
  • hideshow 8 child comments
  • [–] 11 points 9 months ago (5 children)

    That dust is looking fine. I have been using btop myself.

  • source
  • parent
  • hideshow 5 child comments
  • [–] 4 points 9 months ago* (last edited 9 months ago) (4 children)

    I find btop's color schemes don't work well with changing between light and dark mode in the terminal when theme background is turned off.

  • source
  • parent
  • hideshow 4 child comments
  • [–] 3 points 9 months ago (3 children)

    This is very true. I find flat-remix-light to be somewhat decent (still pretty bad) among the options.

  • source
  • parent
  • hideshow 3 child comments
  • [–] 2 points 9 months ago (2 children)

    Okay cool, I'll test that out. Thanks!

  • source
  • parent
  • hideshow 2 child comments
  • [–] 15 points 9 months ago (3 children)
  • [–] 1 point 9 months ago (2 children)

    What's wrong with the MIT License? It's one of the most permissive licenses out there. I don't see how a copy-left clause like others are saying would change things. If someone wants to compile this in to their own proprietary file explorer or something, who cares? Everyone still has access to the original.

  • source
  • parent
  • hideshow 2 child comments
  • [–] 5 points 9 months ago* (last edited 9 months ago) (1 child)

    What's wrong with the MIT License?

    Good question.

    Failure to copyleft contributes to "embrace extent extinguish", which many of us feel is a constant threat to the ecosystem of our favorite tools.

    For example, Google can make a better expanded XMPP client, and keep extending it until the open XMPP clients are no longer compatible - drawing most of the userbase away from the free open ecosystem. (Source: I fell for that shit, and I lost track of dear friends who I used to regularly chat with over XMPP.)

    MIT license also risks security patches being written by big corporations for their own use, and not getting contributed back to the commons.

    I'm not really sure these risks particularly apply for a 'cp' variant, honestly.

    But I'm onboard now with not making anything unnecessarily MIT license.

  • source
  • parent
  • hideshow 1 child comment
  • [–] 2 points 9 months ago

    Google could have done that from the spec though. Google is doing that with chromium despite the source being entirely available

    even agpl wouldn't protect this tool in most cases if a company didn't want to contribute back, since it's probably just used in server side scripts and such. also companies aren't required to upstream stuff, just make source available, which means hard to discover ftp site with a pile of code.

    sure something more copyleft is better for large, more commercial projects, but this in particular probably gets more patches from the extra use in the rust community from MIT than they would forcing companies to open source changes

  • source
  • parent