How kill cp in Linux?

19,882

Solution 1

Just try CTRL+C in the terminal which cp works in. (I've assumed that you didn't send cp to background, which I don't do often.)

Solution 2

You can't kill process if it waits for some kernel syscall. For example if drive is busy or filesystem is otherwise locked up then you can't kill this process. How does your process look like if you do "ps -l". WCHAN and STAT are attributes you need to look at.

Share:
19,882

Related videos on Youtube

rpitch s
Author by

rpitch s

Updated on September 18, 2022

Comments

  • rpitch s
    rpitch s over 1 year

    I see in:

    ps aux 
    

    that exists process like:

    cp  file.txt /home/file.txt
    

    This file is very big.

    I try to kill like:

    kill -9 12345
    

    12345 is pid. But without success. What else I can do? What the reason?

    P.S. 12345 0.0 0.0 7890 704 ? D 14:42 0:05 cp

    • Patrick B.
      Patrick B. over 12 years
      Please give the full line of the process in ps aux.
    • Karoly Horvath
      Karoly Horvath over 12 years
      kill should work.. do you copy from/to a special drive which can block/jam like CD or some network drive?
    • Diogo
      Diogo over 12 years
      You can stop the process using CTRL+C. This will send a signal to cp stop.