LinuxQuestions.org
Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-04-2008, 01:59 AM   #1
cghcgh
Member
 
Registered: Mar 2008
Posts: 69

Rep: Reputation: 15
Question 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?
 
Old 06-04-2008, 03:19 AM   #2
jschiwal
LQ Guru
 
Registered: Aug 2001
Location: Fargo, ND
Distribution: SuSE AMD64
Posts: 15,733

Rep: Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670Reputation: 670
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

Last edited by jschiwal; 06-04-2008 at 03:20 AM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Finding a Moved File: Fedora Core 3 mcupples Linux - Server 6 03-30-2007 03:57 PM
A copied file != a moved file Caesar Tjalbo Linux - Newbie 4 11-09-2006 08:05 AM
I changed a file now I can't log in trappleye Linux - General 3 07-17-2006 02:50 PM
mv is producing an warning for every moved file raees Linux - Software 2 05-10-2005 02:30 PM
file rights changed? monc Linux - Networking 3 11-19-2003 10:20 PM


All times are GMT -5. The time now is 02:48 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration