cpx Introduced as a Faster, Modern Replacement for Linux cp

A new Rust-based tool called cpx offers a modern alternative to the traditional cp command on Linux, adding parallel copying, progress bars, resume support, and configurable defaults.

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.

Benchmarks published by the project show copy times up to four to five times faster than cp on large file sets. Now, let’s cycle through the main characteristics of cpx.

  • Parallel file copying: cpx performs multiple copy operations concurrently. Users can control the level of parallelism, allowing the tool to better utilize fast storage and multi-core systems.
  • Progress reporting: The tool includes built-in progress bars that show the copy’s real-time status. Progress output is customizable and can be configured globally or per project.
  • Resumable transfers: Interrupted copy jobs can be resumed later using checksum verification, and already copied files are automatically skipped.
  • Exclude patterns: cpx supports exclude rules similar to .gitignore, allowing users to omit files or directories such as version control metadata, build outputs, or temporary files. Excludes can be defined on the command line or in configuration files.
  • Persistent configuration: Defaults for copy behavior can be stored in configuration files at the project, user, or system level. Settings include recursion, parallelism, progress style, reflink usage, and attribute preservation.
  • Linux-specific filesystem features: The tool supports extended attributes, SELinux context preservation, timestamps, ownership, hard links, and optional copy-on-write reflinks on supported filesystems.
  • Flexible copy behavior: cpx includes options for interactive overwrites, backups, handling of symlinks and hard links, attribute-only copies, and fine-grained control over how destinations are created or replaced.

Installation is very simple, available via a shell script. To get started with cpx, just run:

curl -fsSL https://raw.githubusercontent.com/11happy/cpx/main/install.sh | bashCode language: Bash (bash)

While macOS and Windows support are listed on the project roadmap, the current release focuses exclusively on Linux. For more information, see the tool’s GitHub page.

Bobby Borisov

Bobby Borisov

Bobby, an editor-in-chief at Linuxiac, is a Linux professional with over 20 years of experience. With a strong focus on Linux and open-source software, he has worked as a Senior Linux System Administrator, Software Developer, and DevOps Engineer for small and large multinational companies.

5 Comments

  1. Hekkaryk

    “Installation is very simple, available via a shell script. To get started with scp, just run:”
    Looks like mistake, it’s likely cpx not scp. I’m interested in this project, looks worthwhile if only for progress bar and resume (I know that rsync can resume, but not everybody does).

  2. Polyfish0

    Cpx is not always faster. It is mainly on SSD drives faster. And for a single file it is slower than cp

  3. Dennis Faucher

    That’s nice and appreciated

    rsync does a lot of this, correct?

    1. Dan

      I was wondering how it compares to rsync. It sounds like duplicating what already works, with less functionality, for the sake of making a rust thing.

      1. Tal

        That’s a good question. I would argue that it’s the same argument for Linux having both cp and rsync, even though rsync already does everything cp does and more. Often, simplicity beats a ton of functionality. cp wins when you just need to copy some files from one directory to another.

        Other times, when you need to be able to sync two directories on two different servers using hashes for comparison, you want rsync.

        I’d love to hear what others think

Leave a Reply

Your email address will not be published. Required fields are marked *