Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Let's say you have a /target directory containing
- Code:
- pic1.jpg
- pic2.jpg
- pic3.jpg
- pic4.jpg
- ...
- and you want to create some links in /linksource
- Code:
- lnkpic1 pointing to pic1.jpg
- lnkpic2 pointing to pic2.jpg
- lnkpic3 pointing to pic3.jpg
- lnkpic4 pointing to pic4.jpg
- ...
- to create those lnkpic* link you can for example :
- just
- Code:
- cd /linksource
- for i in /target/pic*.jpg
- do
- t=${i##*/}
- ln -s "$i" lnk"${t%.*}"
- done
- If what you want is something else for example, you want /linksource to be a link to /target so that if someone do cd /linksource, he goes to /target and can see the pic*.jpg,
- then
- Code:
- ln -s /target /linksource
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement