Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
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.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
[mherring@mystical newplay]$ for file in $(ls -R ../play/*); do ln -s $file; done
In this example, the command is run in the "newplay" directory**, which is at the same level as "play". It works fine, but the only issue is that it creates some bogus links based on the output format of "ls -R". This should be easy to fix.
**When making soft links, I always "link in" by running the ln command from inside the target folder. It avoids certain kinds of errors, and involves less typing.
Why do you want symlinks for all files in the folders ?
Surely just linking the folder is sufficient. Any actions on the symlink will be actions on the original anyway.
If you were prepared to have your ALL folder one level higher, all you'd have to do is ln -s Folder and it would contain all the folders and all the files.
Unless you want a completely flat structure with no subdirectories visible, but you will have to be careful of duplicate names.
"Unless you want a completely flat structure with no subdirectories visible, but you will have to be careful of duplicate names."
Yes, this is what I want. There will be no duplicate names. It's important to have the files accessible via both a single flat directory and their original directory structure.
this will descend into folder /path/to/top/level/directory and it will create links into folder /path/to/link/directory. It is mandatory that you specify the full path of the top level directory containing all the files you want to link, otherwise the links themselves will result broken.
That's strange. The error stats there's nothing after -exec. Please, can you copy/paste the actual command line from your terminal, including the error message?
I wonder if the same error pops up if you use a different command after -exec. Anyway, which version of find do you have? If it's really a bug, maybe we have to submit it...
Thanks a ton
Strange that it did not work with the slash in there.
Weird. I wasn't really expecting it to work.
The + at the end is actually faster than the \; anyway, so I tend to favour it when using find with exec: it makes find behave more like find and xargs does. Instead of a single invocation of the program being exec'ed for each file found, it collects a number of files and passes them all as arguments to a single instance of the exec'ed command, thus dramatically reducing the number of called to the exec'ed command, thereby increasing the speed of execution.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.