You are not logged in.

#1 2016-09-20 19:57:24

jbodhorn
Member
Registered: 2015-12-11
Posts: 130

status output while copying and/or moving files at the command line

I use the command line for copying files frequently, normally having the status of how much has been copied doesn't matter, but for large files it would be nice to have some sort of status output. ATM antthing would be nice for output when moving or copying large files, how much has been copied, how much is left, a time estimate, something so I know I'm not staring at a frozen machine.

I know DD has status=progress, I use that all the time, do "cp" and/or "mv" have any means of giving you the status of the copy or move?

Offline

#2 2016-09-20 20:03:36

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: status output while copying and/or moving files at the command line

man pv

No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#3 2016-09-20 20:07:57

WorMzy
Forum Moderator
From: Scotland
Registered: 2010-06-16
Posts: 11,858
Website

Re: status output while copying and/or moving files at the command line

Not in the repository versions. There is a patched version of coreutils on the AUR, but I would recommend just using a different application with a "progress" option, like rsync.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#4 2016-09-20 20:16:52

2ManyDogs
Forum Fellow
Registered: 2012-01-15
Posts: 4,645

Re: status output while copying and/or moving files at the command line

A couple of ways:

rsync --progress oldfile newfile
pv oldfile > newfile

Or try the AUR package advcp.

(edit) snaked again.

Last edited by 2ManyDogs (2016-09-20 20:17:34)

Offline

#5 2016-09-20 20:36:58

alphaniner
Member
From: Ancapistan
Registered: 2010-07-12
Posts: 2,810

Re: status output while copying and/or moving files at the command line

2ManyDogs wrote:
rsync --progress oldfile newfile

FWIW I generally prefer '--info=progress2' to '--progress'.


But whether the Constitution really be one thing, or another, this much is certain - that it has either authorized such a government as we have had, or has been powerless to prevent it. In either case, it is unfit to exist.
-Lysander Spooner

Offline

#6 2016-09-20 21:39:26

jbodhorn
Member
Registered: 2015-12-11
Posts: 130

Re: status output while copying and/or moving files at the command line

slithery wrote:
man pv

I'll check that out

The tips to use rsync and it's options --info=progress2 and --progress are great, thanks to those who pointed that out and also thanks for mentioning pv. I've never used pv before and didn't know about it.

I've only used rsync a couple times. I was playing with rsync for the first time a few days ago to make some backups, I hadn't thought to use rsync instead of cp for large files.

Offline

#7 2016-09-20 21:46:42

HiImTye
Member
From: Halifax, NS, Canada
Registered: 2012-05-09
Posts: 1,072

Re: status output while copying and/or moving files at the command line

just remember that it's not accurate on for instance USB transfers, as it shows you the progress of moving it into the USB cache, not the progress of it writing out, and therefore it can sit there at 100% for several seconds

Offline

#8 2016-10-07 03:25:09

jbodhorn
Member
Registered: 2015-12-11
Posts: 130

Re: status output while copying and/or moving files at the command line

HiImTye wrote:

just remember that it's not accurate on for instance USB transfers, as it shows you the progress of moving it into the USB cache, not the progress of it writing out, and therefore it can sit there at 100% for several seconds

I didn't know that, thank you. I posted this question because sometimes I'll have to move files that are either so big or there are so many that it takes many hours. Having some sort of status output so I know a copy or move is actually happening and that I didn't mistype, run out of space, or have a crash was my concern. More than once have I set something to copy or move and gone to bed not knowing if it was working properly, hoping for the best... not knowing gets old even though I've only had a fail a few times

Offline

#9 2016-10-07 11:34:44

Trilby
Inspector Parrot
Registered: 2011-11-29
Posts: 29,525
Website

Re: status output while copying and/or moving files at the command line

In that case:

cp /path/to/src/* /path/to/dest

switch to another terminal:

ls -l /path/to/dest

Repeat the second as necessary to convince yourself it's working.


"UNIX is simple and coherent..." - Dennis Ritchie, "GNU's Not UNIX" -  Richard Stallman

Offline

Board footer

Powered by FluxBB