changing a file at a time located in two locations
Hi.
Iam very new to linux. suppose i have two file with same name fstab one file is located in /etc and the other is located in /root/ If i make a change in /etc/fstab file the changes has to reflect in /root/fstab . Is there any command to do this? Kindly help me... Mythili |
Is the file in /root intended to be a backup of the file in /etc?
If the file in /root is NOT intended to be a backup of the file in /etc then you can actually have only one file and create the illusion of having a second file. Use file links to create this illusion. First remove the real file in /root. Code:
rm /root/fstab Code:
ln /etc/fstab /root/fstab |
I tried with ln ,ln -s but if i make changes in /etc/fstab that are not showing in /root/fstab
I need that to happen |
Open a terminal window.
Code:
cd /root |
ln /etc/fstab /root/fstab
ln: creating hard link `/fstab': File exists In /etc/fstab has some content but in /fstab is empty file. |
Quote:
I think at this point you should create a backup of /etc/fstab. Please do this before going any further. Code:
cp /etc/fstab /etc/fstab.original When someone asks you to copy what you see in a terminal window that means to highlight that part of the terminal window, click the right hand mouse button, select copy, bring the mouse to the post that you are creating here, press the right hand mouse button, and select paste. |
Thank you very much ,it works for me...
|
All times are GMT -5. The time now is 08:43 PM. |