Linux安装CP,MV命令显示进度条
复制效果:
安装
作者地址:jarun/advcpmv: A patch for GNU Core Utilities cp, mv to add progress bars (github.com)
手动安装
- 下载相应的依赖coreutils安装包:
wget http://ftp.gnu.org/gnu/coreutils/coreutils-9.1.tar.gz
- 解压依赖:
tar -zxvf coreutils-9.1.tar.gz
- 切换进入依赖目录:
cd coreutils-9.1.tar.gz
- 拉取作品补丁:
wget https://raw.githubusercontent.com/jarun/advcpmv/master/advcpmv-0.9-9.1.patch
- 编译安装:
./configure && make
- 复制生成文件:
cp ./src/cp ../advcp
cp ./src/mv ../advmv
- 移动到安装目录:
sudo mv ./advcpmv/advcp /usr/local/bin/
sudo mv ./advcpmv/advmv /usr/local/bin/ - 加入自己当前bash:
-i 表示交互复制或者移动,-g为显示进度条
echo alias cp '"/usr/local/bin/advcp -ig"' >> ~/.bashrc
echo alias mv '"/usr/local/bin/advmv -ig"' >> ~/.bashrc
使用作者脚本安装
- 下载并执行脚本:
curl https://raw.githubusercontent.com/jarun/advcpmv/master/install.sh --create-dirs -o ./advcpmv/install.sh && (cd advcpmv && sh install.sh)
- 同上进行移动和加入bash:
sudo mv ./advcpmv/advcp /usr/local/bin/
sudo mv ./advcpmv/advmv /usr/local/bin/
echo alias cp '"/usr/local/bin/advcp -ig"' >> ~/.bashrc
echo alias mv '"/usr/local/bin/advmv -ig"' >> ~/.bashrc
本博客所有文章除特别声明外,均采用 CC BY-NC-SA 4.0 许可协议。转载请注明来源 Bai's Blog!