I can move files with this command:
mv -t /mnt/hdd /home/me/movies/movie1.avi /home/me/movies/movie2.avi
The problem is, that it shows no progress at all, so I don't know if the operation is 1% done or 80% done.
I know that rsync is able to show progress.
So how would an rsync variation of that command above look like, while also showing the progress of the operation?
Thank you
You can use the Coreutils Progress Viewer
progress
. After installing it1, simply send yourmv
process to the background and provideprogress
with its PID:Use
progress -w
to show a list of all running coreutils processes with their progress. Seeman progress
and its github page for more options and examples.Further reading with a lot of different approaches:
How can I move files and view the progress (e.g. with a progress bar)?
1: If you’re using Ubuntu 14.04 you’ll unfortunately have to build the software yourself, see the above linked github page.
Background
mv
is only renaming the link to the inode, when moving a file/directory within the same file system [partition]mv
is copying the file/directory and after that removing the original one between file systems [partitions].In your example, you move to another file system, so
rsync
will do the same job (copying). You can add a command to remove the original directory tree afterwards (when you are sure that the copying really worked). This can be done in a shellscript (that allows some manual inspection, at least until you feel safe with the operation).From
man rsync
Run the same
rsync
command line again, and if it does not transfer anything, the files are copied and you can remove the original files or directory tree.Example
Copy with
rsync
Check (if you wish)
Remove files and directories with
It would look like:
Example: