Linux - NewbieThis 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!
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Introduction to Linux - A Hands on Guide
This guide was created as an overview of the Linux Operating System, geared toward new users as an exploration tour and getting started guide, with exercises at the end of each chapter.
For more advanced trainees it can be a desktop reference, and a collection of the base knowledge needed to proceed with system and network administration. This book contains many real life examples derived from the author's experience as a Linux system and network administrator, trainer and consultant. They hope these examples will help you to get a better understanding of the Linux system and that you feel encouraged to try out things on your own.
Click Here to receive this Complete Guide absolutely free.
This is actually on OS X, but I figured the CLI tools are (more or less) the same.
I have a directory(webserver documents) that has several levels of subdirectories inside it. A number of the files in these directories are soft links.
The real files actually exist in my home directory. I want to move these files out of my home directory and into the webserver's documents directory. AKA replace the soft links with the actual file.
If I try to copy the file on top of the soft link, I get a "cp: ./BLP_Head_1.JPG and /Users/jacob/images/BLP_Head_16May2005/BLP_Head_1.JPG are identical (not copied)." error.
I'm running the Gallery2 program, which provides an image gallery and allows the user to move files/albums around. Therefore, the directory structure of the links and the files differ, so I can't simply remove the links and copy the files over.
Is there an easy way to change the soft links into actual files? Or change them into hard links, so I can remove the files from the home directory and effectively do the same thing?
What probably happened when you tried to copy the files "on top of the soft link" as you said was that it tried copied the original file, and then tried to paste it to the same place - the copy tool followed the link in both of the situations, in copying and pasting. What you would have wanted to, I guess, was to copy the file to which the link points and paste it to the other directory, not the one where the link points. If you use that approach, you'd need to tell the copy tool not to follow the link..in my opinion it's the same operation, though, as if you would delete the links and simply copy the original files to their place (=overwrite the links with the original files).
I'm not a master but I'd see the easiest way is to simply delete the links and copy/move the original files to their place and then deal with the gallery program (rebuild an index or something..I haven't used too many of those).
The link exists in: /Library/Webserver/Documents/tc22/g2data/albums/pics/BLP/BLP_Head_16May2005/BLP_Head_1.JPG
which points to the file above.
cp /Users/jacob/images/BLP_Head_16May2005/BLP_Head_1.JPG Library/WebServer/Documents/tc22/g2data/albums/pics/BLP/BLP_Head_16May2005/BLP_Head_1.JPG
fails with :
cp: /Library/WebServer/Documents/tc22/g2data/albums/pics/BLP/BLP_Head_16May2005/BLP_Head_1.JPG and /Users/jacob/images/BLP_Head_16May2005/BLP_Head_1.JPG are identical (not copied).
I also tried with the -f flag, same results.
It does look like cp is following the link for the destination, and OS X's cp doesn't see to have a --no-dereference option.
The gallery2 program I'm using uses mysql to handle all the stuff, so I think if I manually move files around the filesystem it would pretty much blow away the gallery. Having to recreate the gallery would be an extremely non-trivial task