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

2010-11-11 124 words 1 min read

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

author

Authored By Amit Agarwal

Amit Agarwal, Linux and Photography are my hobbies.Creative Commons Attribution 4.0 International License.

We notice you're using an adblocker. If you like our webite please keep us running by whitelisting this site in your ad blocker. We’re serving quality, related ads only. Thank you!

I've whitelisted your website.

Not now
This website uses cookies to ensure you get the best experience on our website. Learn more Got it