【笔记】Linux编译包含进度条的cp和mv命令

前言

Linux编译包含进度条的cp和mv命令

下载项目

1
2
wget ftp.gnu.org/gnu/coreutils/coreutils-8.32.tar.xz
tar -Jxvf coreutils-8.32.tar.xz
1
git clone https://github.com/jarun/advcpmv.git

打补丁

1
2
cd coreutils-8.32
patch -p1 -i ../advcpmv/advcpmv-0.8-8.32.patch

编译

FORCE_UNSAFE_CONFIGURE=1:强制以root身份编译

1
2
FORCE_UNSAFE_CONFIGURE=1 ./configure
make

cp或mv时显示进度条

coreutils-8.32/src/
1
./cp --progress-bar <file_source> <file_target>
coreutils-8.32/src/
1
./mv --progress-bar <file_source> <file_target>

完成

参考文献

博客园——苍青浪