When you run into this kind of thing (which happens from time to time) there are a few things you could do.
First, you need a new prompt. If you are using a graphical user interface, this should be as easy as opening a new terminal window. If you are not, you should be able to switch to another tty
by using Ctrl+Alt+F2 for example. Another alternative is to pause the current command using Ctrl+z. You can check what jobs you have paused using the command jobs
and let the program run again by using, for example bg 1
, where bg
stands for background.
Once you have a prompt, and the program you think takes too much time is still executing, you can start doing some investigations. One thing to look at is whether the destination is actually being filled:
ls /home/danai/destination_folder
Run the command a few times. Does the output change? If so, you are fine. If not, we need to check further.
Check if your drive is filling up:
df
Run the command a few times - or put a watch on it:
watch df
Does the output change? Is there a drive (containing your home directory) filling up? If so, the command is running, and is working, and is copying something.
Have a look at what you are copying:
du --summarize -h /mnt/external/directory_to_be_copied
This will tell you, approximately, the size of the directory you are copying. This could give you a hint about how much time it will take.
If all this fails, the source might not really be a directory, but rather some kind of mean device filling up your file system. There are such devices. If you watch df
you can see if a file system is filling up. If so, you probably want to abort.
Go back to the terminal or tty you used to start the cp
(probably tty1 at Ctrl+Alt+F1, if you didn't already change it) or put the command back in the foreground using fg 1
(or whatever number your job had, but probably 1), and abort it with Ctrl+C.
As a side note - when you copy directories, you probably want to use cp -r
to copy any subdirectories as well.
rsync
is preferable for large scale copying:rsync -a --info-progress2 source/ target