命令列中複製移動時顯示進度條

來源:互聯網
上載者:User

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
1
scp SRC localhost:DST
使用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
1
2
cp

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.