Duplicate directory in same partition help.


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Duplicate directory in same partition help.
# 1  
Old 10-22-2009
Duplicate directory in same partition help.

Hi,

I have found a directory on my web server that have 2 same directory names in the same location on the same partition. Is there a way to mkdir a name twice and be able to see them both in the same location?

Heres an example of the ouput:

Code:
[root]# ls
access_log.1.bkup       access_log.1.bkup.2.gz  data         public_html 
access_log.1.bkup.1.gz  access_log.1.bkup.3.gz  public_html

Unix forbids the same file name under the same directory. How could this be possible?

As you can see there are two public_html directories and they both have two different inode numbers but when you cd into public_html which one would you end up in?
Is there some way to know which one is the suspicious one? I would like to delete the suspicious public_htm. I believe an unauthorized access has created this duplicate and doing something malicious.

I have use the command find . -inum 293843 | xargs cd to try to change directory to the one I thought was suspicious but I get an error message saying directory doesn't exist. And the same error message for the other directories by trying to CD into a directory by specifying the inode instead of the file name.

Any help and ideas would be appreciated!

I need to cd into a directory by specifying the inode number and not the file name.
I would aslo like to know the possibility of creating two same name folders under same directory.

Best Regards,[COLOR="#738fbf"]

Last edited by maiku09; 10-23-2009 at 02:10 PM..
# 2  
Old 10-22-2009
Hi.

Can you show the result of an ls -ld * command?
# 3  
Old 10-22-2009
Check the output of 'ls -lb'. Any non-printing characters should show up escaped, in case the second directory has them.

If that doesn't help try running an fsck on the mount in question.
# 4  
Old 10-22-2009
Quote:
Originally Posted by pludi
Check the output of 'ls -lb'. Any non-printing characters should show up escaped, in case the second directory has them.

If that doesn't help try running an fsck on the mount in question.
Yes, thanks! (I always type ls -ld out of habit)
# 5  
Old 10-22-2009
This is the output of ls -d *
Code:
drwxrwxr-t  34 root       sappy  4096 10��10 16:17 public_html
drwxrwxrwx   2 sappy www         4096  5��26 11:37 public_html

This is the output of ls -ld
Code:
drwxr-x---  5 sappy www 4096 Oct 22 00:55 .

Before I delete the suspicious one by specifying the inode with the find command I wanted to CD into it to see if there is anything interesting. But I can not find a way to CD into a directory by specifying just the inode instead of the filename.

Has anyone ever experienced having two same directory in the same location before?

Last edited by maiku09; 10-22-2009 at 10:19 AM..
# 6  
Old 10-22-2009
First, please use code tags for listings, command lines, ...

Second, please post the output of 'ls -lb'
# 7  
Old 10-22-2009
Pludi,

Sorry about not using code tags.

I was able to list the contents of the directory with:

Code:
 find . -inum "inode#"  -exec ll -b {} \;

I guess that will do but I initially was looking for a way CD into directory specifying inode number.

For example:

Code:
[root]# find . -inum 987231 | xargs cd
xargs: cd: No such file or directory

or

Code:
[root]# find . -inum 987231 -exec cd {} \;
find: cd: No such file or directory

Thanks.
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Red Hat

Shrink LVM partition & create new Linux Primary partition

Hello All, I have a Red Hat Linux 5.9 Server installed with one hard disk & 2 Partitions created on it as follows, /boot - Linux Partition & another is LVM - One VG & under that 5-6 Logical volumes(var,opt,home etc). Here my requirement is to take out 1GB of space from LVM ( Any logical... (5 Replies)
Discussion started by: gr8_usk
5 Replies

2. UNIX for Dummies Questions & Answers

Duplicate home directory

Hi, I'm running a RHEL6 machine on a VMWare platform and I have somehow created a duplicate /home directory. See below. # pwd /home/home/twood # ls Desktop Documents Downloads Music Pictures Public Templates Videos # I am currently working on some disk quota procedures and I... (2 Replies)
Discussion started by: tjwops
2 Replies

3. UNIX for Dummies Questions & Answers

How to scrub directory only if on own partition/drive?

Hi all, I've been working on a script to run a disk wipe (using Jim Garlick's scrub tool) on the filesystem in Xerox production printer RIPs. Easy enough if there's just one partition, but I need to cater for the possibility of multiple drives/partitions, and either ZFS or UFS (don't know if... (2 Replies)
Discussion started by: DavidDawesFXA
2 Replies

4. Solaris

Partition overlaps another partition while creating new parition in solaris

hi all while formatting hard disk i am getting following error. Partition 1 ends at 266338338 It must be between 34 and 143374704. label error: EFI Labels do not support overlapping partitions Partition 8 overlaps partition 1. Warning: error writing EFI. Label failed. I have formatted the... (2 Replies)
Discussion started by: nikhil kasar
2 Replies

5. Shell Programming and Scripting

Remove duplicate files in same directory

Hi all. Am doing continuous backup of mailboxes using rsync. So whenever a new mail arrives it is automatically copied on backup server. When a new mail arrives it is named as xyz:2, when it is read by the email client an S is appended xyz:2,S Eventually , 2 copies of the same file exist on... (7 Replies)
Discussion started by: coolatt
7 Replies

6. UNIX for Dummies Questions & Answers

Delete duplicate files from one of two directory structures

Hello everyone, I have been struggling to clean up a back-up mess I created when manually duplicating a directory structure and then working in both of them.. The structures now are significantly different and contain in the order of 15 k files of which most are duplicates. Now I am trying to... (0 Replies)
Discussion started by: procreator
0 Replies

7. Shell Programming and Scripting

script that detects duplicate files in directory

I need help with a script which accepts one argument and goes through all the files under a directory and prints a list of possible duplicate files As its output, it prints zero or more lines, each one containing a space-separated list of filenames. All the files listed on one line have the same... (1 Reply)
Discussion started by: trueman82
1 Replies

8. UNIX for Dummies Questions & Answers

I've created a partition with GNU Parted, how do I mount the partition?

I've created a partition with GNU Parted, how do I mount the partition? The manual information at http://www.gnu.org/software/parted/manual/parted.html is good, but I am sure about how I mount the partition afterwards. Thanks, --Todd (1 Reply)
Discussion started by: jtp51
1 Replies

9. Shell Programming and Scripting

remove duplicate files in a directory

Hi ppl. I have to check for duplicate files in a directory . the directory has following files /the/folder /containing/the/file a1.yyyymmddhhmmss a1.yyyyMMddhhmmss b1.yyyymmddhhmmss b2.yyyymmddhhmmss c.yyyymmddhhmmss d.yyyymmddhhmmss d.yyyymmddhhmmss where the date time stamp can be... (1 Reply)
Discussion started by: asinha63
1 Replies
Login or Register to Ask a Question