命令行中复制移动时显示进度条
2012-03-16 17:01
169 查看
from:here
“世间最痛苦的事莫过于等待”,相信使用过Shell中cp或者mv命令操作大文件的朋友们都有这种感慨。要是能显示复制或者移动的进度,把无尽的等待变成有限的期待,那该多好呀!其实,确实有显示进度条的方法,而且方法还不止一种:
PS: An update is scheduled to be released in just three weeks, on March 24, 2012
“世间最痛苦的事莫过于等待”,相信使用过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[/code]tar xvzf coreutils-8.4.tar.gzcd coreutils-8.4/wget http://beatex.org/web/advcopy/advcpmv-0.3-8.4.patch[/code]patch -p1 -i advcpmv-0.3-8.4.patch./configuremakesudo cp src/cp /usr/local/bin/cpgsudo cp src/mv /usr/local/bin/mvg#vim ~/.bashrcalias cpg="/usr/local/cpg -g"alias mvg="/usr/local/mvg -g" |
使用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 SRC /proc/self/fd/1 | pv -s SIZE -p -e -r | cp /proc/self/fd/0 DST #cp does not accept to write to standard output by default. It will fail if no input or output is given. So, in order to make it pipe to pv, we use /proc/self/fd/N. fd 0 represent standard input, fd 1 standard output and fd 2 standard error (we don't need that one for this purpose). |
相关文章推荐
- 使用C#在进度条中显示复制文件的进度
- 使用C#在进度条中显示复制文件的进度
- IFileOperation实现复制文件时显示进度对话框
- VB 在指定的进度条和标签中显示文件复制进度
- IFileOperation实现复制文件时显示进度对话框
- 复制文件显示进度
- 复制已知文件夹下所有内容,显示进度
- 文件复制过程中显示进度条(九)
- vim介绍、颜色显示和移动光标、一般模式下移动光标和一般模式下复制、剪切和粘贴
- 复制文件时,如何显示进度条(使用BlockRead函数读取数据,并插入application.ProcessMessages)
- vim介绍,vim颜色显示,vim一般模式下移动光标,vim一般模式下的复制、剪切和粘贴
- 复制已知文件夹工具(显示进度)
- 将c:\windows.复制到当前目录并显示进度的批处理文件
- Java复制文件使用进度条显示
- 使用C#在进度条中显示复制文件的进度
- Android使用SeekBar时动态显示进度且随SeekBar一起移动
- Qt 实现文件复制 界面有进度条(根据文件大小)显示复制进度,
- 根据文件大小显示文件复制进度条
- 命令行下显示进度
- Android NumberProgressBar:动态移动显示百分比进度的进度条