LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 09-26-2011, 02:34 AM   #1
manaila
LQ Newbie
 
Registered: Apr 2010
Posts: 29

Rep: Reputation: 0
Question An Unusual File Modification


Hi,
I am not sure if anyone has ever encountered this. I have different text files stored in an embedded Linux; now, when I edit one file, the editing also appears in all other files! This occurred after I have replaced all the files but two with cp -rp command and the remaining files with the same command!
This is worrying me, how can I resume normal independent file modification?
 
Old 09-26-2011, 05:11 PM   #2
Doc CPU
Senior Member
 
Registered: Jun 2011
Location: Stuttgart, Germany
Distribution: Mint, Debian, Gentoo, Win 2k/XP
Posts: 1,099

Rep: Reputation: 343Reputation: 343Reputation: 343Reputation: 343
Hi there,

Quote:
Originally Posted by manaila View Post
I have different text files stored in an embedded Linux; now, when I edit one file, the editing also appears in all other files!
are you sure your files are all separate and unconnected? What you describe sounds like they're just symlinks or hardlinks, and they all point to the very same file. Can you check that (e.g. using ls -la)?

[X] Doc CPU
 
Old 09-28-2011, 09:34 AM   #3
manaila
LQ Newbie
 
Registered: Apr 2010
Posts: 29

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Doc CPU View Post
What you describe sounds like they're just symlinks or hardlinks, and they all point to the very same file. Can you check that (e.g. using ls -la)?
I have checked the files using ls -il, and as you said, Doc CPU, it looks like the files are all hard links to the same file since they have the same inode number. Thank you for that help.
I have solved it by copying each file at a time.
Why do they become hardlinks when they are copied together at a go, using cp -rp command? I used to do this before and they didn't become hardlinks!

Last edited by manaila; 09-28-2011 at 09:44 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
Can anyone help me with this file modification problem? Deadally Programming 11 06-10-2011 11:31 AM
Sudoers File Modification musclehead Linux - Newbie 1 07-13-2009 12:53 PM
file modification time graziano1968 Linux - Server 1 08-25-2008 10:06 AM
sendmail.cf file modification dody1313 Solaris / OpenSolaris 1 07-30-2008 11:25 AM
Track File modification dhammika Programming 1 11-25-2005 07:03 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 03:46 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