Home > bash > cpq and mvq: extensions of the Unix commands cp and mv to use a queue

cpq and mvq: extensions of the Unix commands cp and mv to use a queue

You browse your hard drive(s) and you want to copy/move several files to somewhere else. If the files are big (e.g. movies), then you need to wait minutes until a copy/move operation finishes. If the files are in different folders, you cannot select them all. If you try to launch each operation in the background, your machine will get very slow since all these operations will run concurrently.

Clearly, copy/move operations should be put in a queue and the next operation should start when the previous one terminates.

Under Windows you have Total Commander (F5/F6, then F2), but how to do it under Linux? Should I use Total Commander with wine? :) Under Linux I use Midnight Commander but in MC I didn’t find this feature. There is another Norton Commander clone called Krusader that has this feature but I didn’t like it much. I prefer MC :)

So, I came up with the following solution: create two command-line scripts called “cpq” and “mvq” that work like cp and mv (actually they call cp and mv) but they put tasks in a queue. These scripts launch a daemon process if necessary that executes each copy/move operation one after the other.

The project can be found here (https://github.com/jabbalaci/Copy-Queue) where you can also find a description about its installation.

Update (20130403)
Pierre (alias Deimos) wrote about “cpq” and “mvq” in his blog in French: Copy-Queue : un manager de copie de fichiers en ligne de commande.

Categories: bash Tags: , , , , ,
  1. No comments yet.
  1. No trackbacks yet.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: