from:here
“世間最痛苦的事莫過於等待”,相信使用過Shell中cp或者mv命令操作大檔案的朋友們都有這種感慨。要是能顯示複製或者移動的進度,把無盡的等待變成有限的期待,那該多好呀。其實,確實有顯示進度條的方法,而且方法還不止一種: 使用打補丁的cp和mv:Advanced Copy
1
2
3
4
5
6
7
8
9
10
11
12
13 |
wget http://ftp.gnu.org/gnu/coreutils/coreutils-8.4.tar.gz
tar xvzf coreutils-8.4.tar.gz
cd coreutils-8.4/
wget http://beatex.org/web/advcopy/advcpmv-0.3-8.4.patch
patch -p1 -i advcpmv-0.3-8.4.patch
./configure
make
sudo cp src/cp /usr/local/bin/cpg
sudo cp src/mv /usr/local/bin/mvg
#vim ~/.bashrc
alias cpg="/usr/local/cpg -g"
alias mvg="/usr/local/mvg -g" |
PS: An update is scheduled to be released in just three weeks, on March 24, 2012
使用rsync
1
2 |
alias rscp="rsync -ahP"
alias rsmv="rsync -ahP --remove-source-files" |
使用scp
使用bar
1
2
3
4 |
#Copy a file
bar -o outfile infile
#Copy several files to another directory (showing a common progress bar)
bar -c 'cat 》 outdir/${bar_file}' file1 file2 file3 |
使用pv