Howto removing files with the same inode


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Howto removing files with the same inode
# 1  
Old 04-29-2008
[ask] How to delete directories with the same inode ?

Dear all,
# ls -li
total 16
2623392 drwxrwxrwx 2 root root 512 Apr 10 01:57 10HPA-
8447490 drwxr-xr-x 3 root root 512 Apr 14 05:29 118OQ-
8447490 drwxr-xr-x 3 root root 512 Apr 14 05:29 118OQ-.old
1925572 drwxrwxrwx 2 root root 512 Apr 19 02:36 119A1-
5944099 drwxrwxrwx 2 root root 512 Feb 11 09:56 3MJL-
1167719 drwxrwxrwx 2 root root 512 Nov 29 2006 VDKS-
5198312 drwxrwxrwx 2 root root 512 Oct 18 2006 VDLC-
6498521 drwxrwxrwx 2 root root 512 Apr 27 10:22 W4KS-

# rm -r 118OQ-.old
rm: Unable to remove directory 118OQ-.old: File exists
# rm -rf 118OQ-.old
rm: Unable to remove directory 118OQ-.old: File exists
# rm -rf 118OQ-
rm: Unable to remove directory 118OQ-: File exists

I failed to delete those directory have the same inode, Do you know how to remove those directory ?

Kind Regards,
-Fuad-

Last edited by fu4d; 04-30-2008 at 06:39 AM..
# 2  
Old 04-29-2008
I don't have two directories with the same inode, but you could always try to remove them by their inode number :

Code:
find . -inum 8447490 -exec rm -rf {} ';'

# 3  
Old 04-29-2008
Quote:
Originally Posted by rubin
I don't have two directories with the same inode, but you could always try to remove them by their inode number :

Code:
find . -inum 8447490 -exec rm -rf {} ';'

You can also try:-

rm -fr 118OQ*
# 4  
Old 04-29-2008
Hi.

I vaguely recall that long ago, only root was allowed to make hard links to directories.

A quick skim of man pages shows that SunOS vm-solaris 5.10 does not seem to allow that, and Linux 2.6.24-1-686 warns that it may not work even for root.

I suggest you wait for a few more replies, but if I were in this situation and if the -f (force) and running as root does not work, I'd be thinking of making a backup, and running a filesystem check.

Best wishes ... cheers, drl
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Beginners Questions & Answers

Find and removing the old files and zipping the files using shell script

Hi, I am trying to removing the old files which were older than 10 days and same g zipping the files using the shell script. script was return as follows. find /jboss7_homes/JBOSS7/SKYLIV??/SKYLIV??_CRM/jboss-eap-7.0/standalone/log -mtime +10 -type f | xargs rm -f find /cer_skyliv??/log... (6 Replies)
Discussion started by: venkat918
6 Replies

2. UNIX for Dummies Questions & Answers

Q: Howto compare 2 files

Greetings, I made an extraction on 2 different databases. What I need to do is to compare those extractions to know what is on database1 which is not on database2 and vice versa. In those files, there are only numbers. So each line is just a number witch should be present on both file. If... (6 Replies)
Discussion started by: Sekullos
6 Replies

3. Shell Programming and Scripting

Script to temp create files more than inode limit

HI, I am from testing background. I have a scenario of a file generation, through cronjob, on a defined path. After I fill the data as 100 % utilized, my application is generating an empty file on the defined path. # df -kh Filesystem Size Used Avail Use% Mounted on... (3 Replies)
Discussion started by: atulbassi83
3 Replies

4. Shell Programming and Scripting

howto monitor a directory for files then sftp them

Morning all I hope I have put this in the correct forum. I have a requirement to monitor a directory on a server for files being sftp'ed in and then to sftp them of to another server. The issues I have though of are making sure the files have completely transferred onto the server before they... (6 Replies)
Discussion started by: ltodd2
6 Replies

5. Shell Programming and Scripting

HowTo translate KSH Scripts to DOS Batch Files ?

Hi there, in near future I have to change my work surrounding from HP UNIX to Windows Vista (great to get rid of old hardware :), but bad to loose UNIX :( ). As I heavily use KSH scripts to do my job, I was wondering, if there is any HowTo available, supporting me in re-writing the scripts to... (4 Replies)
Discussion started by: Joe-K7
4 Replies

6. UNIX for Dummies Questions & Answers

How to find all files containing "1234" in their inode number?

Hi, if there are 3 files with the following inode numbers: 012345 012346 012347 is there a way to find all those files containing "1234" as inode? i found out that i cant use any wildcards. or i just didnt put them in the right way. find . -inum ... ? thanks 4 help. devil (2 Replies)
Discussion started by: daredevil82m
2 Replies

7. Shell Programming and Scripting

removing old files except configuration files and folders

Dear all, I want to remove files older than 2 months in the /home/member directory. But except the configuration files (like .bash_profile .config/ .openoffice/ .local/ .kde/ etc..) I have tried with the command find . -mtime +60 -wholename './.*' -prune -o -print -exec mv {} \; but it... (1 Reply)
Discussion started by: jamcalicut
1 Replies

8. UNIX for Dummies Questions & Answers

Howto Archive Including Hidden Files?

Hi I want to archive the following all the files and directory like listed below: $ ls -a . .. .bash_history .bash_logout .bash_profile .bashrc .emacs .mysql_history public_html .viminfo What I tried is to use the following command $ gtar cvzf allmyfiles.tar.gz * ... (1 Reply)
Discussion started by: monkfan
1 Replies

9. UNIX for Advanced & Expert Users

Removing files

Hi, It seems someone has created files instead of actually running the commands, as below: -rw-r--r-- 1 oracle92 dba 0 Mar 2 11:19 PRIML_070302.ok -rw-r--r-- 1 oracle92 dba 557 Mar 2 11:20 PRIVH_070302.dat -rw-r--r-- 1 oracle92 dba 0 Mar 12 11:57... (2 Replies)
Discussion started by: LiquidChild
2 Replies

10. UNIX for Dummies Questions & Answers

Removing Files

I am trying to remove a file so that I can delete a directory. Unfortuantely the file looks like this --------.--- and the system is not allowing me to remove the file. System message is rm: Error: Illegal option -- - usage: rm file... I have tried rm * and rm *.* to no avail. Any... (5 Replies)
Discussion started by: Blondie
5 Replies
Login or Register to Ask a Question