Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

So I want to symlink copy all the files and folders in one directory to another directory. When I use cp -s though without the -r option I get a bunch of "omitting directory" warnings, and I don't want to omit directories:

$ cp -s /home/my_username/path_to_directory/* .
cp: omitting directory `/home/my_username/path_to_directory/foo'
cp: omitting directory `/home/my_username/path_to_directory/bar'
cp: omitting directory `/home/my_username/path_to_directory/baz'

If I use the -r option though, it symlinks all the files in the directories instead of symlinking the directories themselves.

How do I non-recursively symlink all files and folders in one directory to another directory?

share|improve this question

1 Answer 1

Nevermind, I figured it out. I can't believe I didn't try this sooner:

ln -s /home/my_username/path_to_directory/* .
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.