Breaking soft link temporarily
The only thing i have been able to find about breaking a soft link is to delete the target file, i need to break a link, test something, then put the link back.
will moving the target file to another folder/directory/whatever you call them in linux (i am a windows dev normally, please dont hate me) break the link then moving it back after i have completed testing and reestablishing the link work? |
Assuming you mean a symbolic link, or symlink. The link is just a pointer to the actual file.
Moving the original file will break the link. Moving it back will fix it. Whether moving the link breaks it depends on whether it points to the absolute or relative path of the original file. For example, if I create a symlink to file foo with an absolute path like this: Code:
~$ ln -s /home/user/foo bar but if I do a relative path: Code:
~$ ln -s foo bar If you delete the symlink, it is always easy enough to recreate it, so that is what is usually done. |
currently the link looks like file->\companyname\test\bin\file1 where file 1 is a shell script that intercepts certain actions (there are three total i need to test), i need to keep that until go live, but also need to test it. i was going to create a dir under \companyname\test\bin\storage the mv file to there, test, then mv file back, if i understand you the simple act of moving the file back will restore the link??
|
Don't forget forward-slash (/) is directory delimiter in Unix/Linux. Backslash (\) is DOS/Windows.
So anyway, yes that should work. The contents of the symlink is just the path to the target! |
All times are GMT -5. The time now is 02:31 AM. |