Skip to content

Instantly share code, notes, and snippets.

@runlevel5
Last active September 12, 2025 09:36
Show Gist options
  • Select an option

  • Save runlevel5/e6d46fede965cf40838d1cb2a5efec15 to your computer and use it in GitHub Desktop.

Select an option

Save runlevel5/e6d46fede965cf40838d1cb2a5efec15 to your computer and use it in GitHub Desktop.
How to replace GNU coreutils with Rust uutils/coreutils locally in your user account in Fedora?

Run following bash script:

#!/bin/bash

# Source and destination directories
SRC_DIR="/usr/bin"
DEST_DIR="$HOME/.local/uubin"

# Ensure destination directory exists
mkdir -p "$DEST_DIR"

# Find files starting with 'uu_' in /usr/bin
find "$SRC_DIR" -type f -name 'uu_*' | while read -r src_file; do
    # Get the base filename
    filename=$(basename "$src_file")

    # Strip the 'uu_' prefix
    stripped_name="${filename#uu_}"

    # Copy to destination with new name, preserving attributes
    cp -u --preserve=mode,timestamps "$src_file" "$DEST_DIR/$stripped_name"

    # Make sure it's executable
    chmod +x "$DEST_DIR/$stripped_name"
done

echo "All uu_ files copied to $DEST_DIR with prefix stripped."

then appending the PATH in your rc profile, if you are using bash, it would be ~/.bashrc or ~/.bash_profile:

export PATH="$HOME/.local/uubin:$PATH"

then reload your shell

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment