function for copy files with progress bar (using pv – pipe viewer)

2010-11-11 1 min read bash Linux

function for copy files with progress bar (using pv – pipe viewer)

  <td>
    <div class="text codecolorer">
      &nbsp;cp_p() { if [ `echo "$2" | grep ".*/$"` ]; then pv "$1" > "$2""$1"; else pv "$1" > "$2"/"$1"; fi; }
    </div>
  </td>
</tr>
1

dont have to type new file name (it copy file under same name) and dont have to use ‘/’ in the end of destination folder (but you can if u want, its idiot proof)

* View this command to comment, vote or add to favourites * View all commands by chmurli

commandlinefu.com

by David Winterbottom (codeinthehole.com)

URL: http://feedproxy.google.com/~r/Command-line-fu/~3/f3Uy8ZDqE8Q/function-for-copy-files-with-progress-bar-using-pv-pipe-viewer

Enhanced by Zemanta
comments powered by Disqus