How would you link a number of files (e.g. *.so) by one-liner in Linux?

2

I need something like

ln -s /from/*.so

But ln doesn't allow such. So how would you do then?

Andrei

Posted 2010-08-05T08:18:18.540

Reputation: 1 164

Answers

4

via shell-builtins (and globoperator)

from l in /from/*.so; do ln -s "$l"; done

via find

find /from/ -name "*.so" -exec ln -s '{}' ';'

doing it via find is better since it works better for huge amount of files.

akira

Posted 2010-08-05T08:18:18.540

Reputation: 52 754

typo: you mean for i guess – matthias krull – 2010-08-05T15:19:15.643