LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   File cannot be changed or moved (https://www.linuxquestions.org/questions/linux-newbie-8/file-cannot-be-changed-or-moved-646861/)

cghcgh 06-04-2008 12:59 AM

File cannot be changed or moved
 
Hi guys,

I was doing a random check on 1 of my folder. i did a ls...and found that i have 2 files with the same name but different attributes(the date and the filesize is different)

What i did is rename SinCashflowReport.sh to SinCashflowReport.sh2. so i only have 1 SinCashflowReport left. i tried to do a "more SinCashflowReport.sh" but it says that "SinCashflowReport.sh: No such file or directory"


-rwxrwxr-x 1 kplus kplus 374 Apr 11 2007 SinCashflowReport.sh
-rwxrwxr-x 1 kplus kplus 3539 Jun 6 2006 SinCashflowReport.sh2

Any ideas guys?

jschiwal 06-04-2008 02:19 AM

My guess is that the filename contains a non-printable character and it just appeared that the filenames where the same.

A common technique for dealing with duplicate filenames or weird filenames is to list them using "ls -i" to list the filenames with their inodes. Then use the find command to select the particular file with the inode you indicate, and use "-exec" or "-execdir" to process the file.
Code:

find . -maxdepth 1 -inum 12345 -okdir rm -f '{}' \;
See the find info manual and search for "inum" for more information.

Also check if their are file attributes or file acls that can cause problems for you.
lsattr
getfacl


All times are GMT -5. The time now is 06:51 AM.