Operating System - HP-UX
1821410 Members
3080 Online
109633 Solutions
New Discussion юеВ

Need to find the inode number of a file and delete it.

 
SOLVED
Go to solution
Andre Lemon
Regular Advisor

Need to find the inode number of a file and delete it.

I have done a ll -i to get the inode for a
file, now i need to delete it, how do i do that?



1262 -rw------- 1 root root 100575232 Apr 28 04:54 1m

Thanks
4 REPLIES 4
Cheryl Griffin
Honored Contributor
Solution

Re: Need to find the inode number of a file and delete it.

# find . -inum 1262 -exec rm {} \;
"Downtime is a Crime."
Paddy_1
Valued Contributor

Re: Need to find the inode number of a file and delete it.

find . -inum 1262 -ok rm {} \
The sufficiency of my merit is to know that my merit is NOT sufficient
Ramkumar Devanathan
Honored Contributor

Re: Need to find the inode number of a file and delete it.

Hi,

I believe you want to check the inode that you have and then remove the file having the particular inode.

So, here goes -

inode=

ls -i | grep $inode | rm -i `awk {print $2}`

HTH.

(Let me know if I am way off track.)

- ramd
HPE Software Rocks!
Andre Lemon
Regular Advisor

Re: Need to find the inode number of a file and delete it.

Thank you Cheryl.


Andre'

This solved my problem.