I am having a problem where i have two directories with same name and different inode number.I want to get rid of newer one but not sure how should i? Because when i change directory i am not sure where i get in and what i am removing:wall:
root@server # ls -lia |grep us000xyz_R5
42734 drwxrwxrwx 35 root other 37 Aug 25 19:38 us000xyz_R5
89538 drwxr-xr-x 3 oracle dba 512 Aug 25 19:20 us000xyz_R5
The problem i have is one of the directory contains all my project critical data and is also mounted as filesystem.The second directory i suspect is created via netbackup restore (I am not sure how) is occupying space under root filesytem and making it full.I want to get rid of second directory which is making root full.But when i change directory i am not sure which directory i am in cause is see same contents :rolleyes:
yes, i agree with you.That's the first thing came into my mind :D,but i don't want to do that.That filesystem is used for hosting 7 zones and un-mounting will mean i need to have production downtime
If I'm reading that correctly, the first entry has a tab or a bunch of spaces after a newline in the name (!?!?). Or your copy-paste went a bit wrong
My prefered method of getting to the bottom of weirdness like this is the cat-vet trick:
ls -li | grep us000xyz_R5 | cat -vet
That will show you any trailing spaces (the cause of 90% of these IME) and/or other oddnesses.
You can even leave off the -li but if you want even simpler output and don't need the inode num right now.
Then you can either attack the dir by name (suggest renaming it via mv first) or by inode number as listed above (find -inum)
Thanks a lot all and especially (Smiling Dragon ) for your reply.It really helped me i can see the space in second one after R5.So i here is what i did to remove the contents first inside it.
root@us000xyz # ls -li |grep us000xyz_R5|cat -vet
42734 drwxrwxrwx 35 root other 37 Aug 25 19:38 us000xyz_R5$
89538 drwxr-xr-x 3 oracle dba 512 Aug 25 19:20 us000xyz_R5 $
root@us000xyz #
root@us000xyz # cd "us000xyz_R5 " --there is space here after R5
root@us000xyz # ls -lrt
total 2
drwxr-xr-x 3 oracle dba 512 Aug 25 19:20 test
root@us000xyz # rm -r test
Below option could have also helped but i wanted to be absolutely sure to check contents by changing directory what i am deleting