Re: How to traverse all file struct

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, 28 Apr 2015 00:58:47 -0000, cmqycmqy said:
> (Again, depending I just want to print process info whitch have open a
> specific file£¨inode£©. Then if i want to delete a file in use,i can just kill
> the process one by one.

No kernel hacking needed for that, you can do it in userspace.

# lsof | grep /your/file/here
# kill -9 ` lsof | grep /your/file/here | awk '{print $2} |uniq '`

Attachment: pgpkM2RJSjPRD.pgp
Description: PGP signature

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@xxxxxxxxxxxxxxxxx
http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux