QUESTION ON REMOVING A FILE BY ITS INODE NUMBER

ITEM: RTA000028234



QUESTION:                                                                       
In unix there is a command 'clri' that allows one to remove a                   
file by its inode number.  AIX does not seem to have this                       
command.  Is there a way to remove a file by its inode number                   
in AIX?  I have looked in info and man pages but have found                     
nothing.                                                                        
                                                                                
---------- ---------- ---------- --------- ---------- ----------                
A: AIX does not have an exact equivalent of the "clri" command, but             
   here is a workaround:                                                        
                                                                                
   find / -inum 1234 -exec rm {} \;     # the {} are left and right             
                                        # braces.                               
                                                                                
   That command will search all mounted filesystems and delete each            
   occurrence of inode number 1234.  What this command actually does is         
   search all mounted filesystems for that inode, and pass the fully            
   qualified path name to the rm command.  The end result would be the          
   same as the clri command, but you are still deleting files by file           
   name.                                                                        
                                                                                
   If you have mounted filesystems which you do not want searched (like         
   NFS or CD-ROM), then you could use the following command instead:            
                                                                                
   find / -fstype jfs -inum 1234 -exec rm {} \;                                 
                                                                                
   This will only search mounted jfs filesystems for inode 1234.                
                                                                                
---------- ---------- ---------- --------- ---------- ----------                
                                                                               
                                                                                
This item was created from library item Q615431      BXNHC                      
                                                                                
Additional search words:                                                        
AIX BXNHC FILE FILES INODE IX JAN93 NUMBER NUMBERING NUMERIC                    
NUMERICAL OP QUESTION REMOVING RISCOSO RISCSYSTEM SOFTWARE SYS                  
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                               


WWQA: ITEM: RTA000028234 ITEM: RTA000028234
Dated: 11/1996 Category: RISCOSO
This HTML file was generated 99/06/24~12:43:10
Comments or suggestions? Contact us