avatar
h*s
1
I have 10 directories under my home directory, named dir1-dir10. Under each
directory, there is one text file named dirX.txt, where X is the index of the
directory. e.g, dir1.txt is under dir1/ and dir6.txt is under dir6/. I have
another directory called alldata under my home directory too.
My question is how can I build a soft link for all those 10 text files
(dirX.txt) under alldata/ directory by some simple command instead of link
them one by one by hand. I am thinking of using find command b
avatar
c*t
2
use perl or cshell, it's simple

【在 h*********s 的大作中提到】
: I have 10 directories under my home directory, named dir1-dir10. Under each
: directory, there is one text file named dirX.txt, where X is the index of the
: directory. e.g, dir1.txt is under dir1/ and dir6.txt is under dir6/. I have
: another directory called alldata under my home directory too.
: My question is how can I build a soft link for all those 10 text files
: (dirX.txt) under alldata/ directory by some simple command instead of link
: them one by one by hand. I am thinking of using find command b

avatar
q*z
3

the
in alldata dir
find .. -name 'dir*.txt'-printf 'ln -s %p `basename %p`'|sh

【在 h*********s 的大作中提到】
: I have 10 directories under my home directory, named dir1-dir10. Under each
: directory, there is one text file named dirX.txt, where X is the index of the
: directory. e.g, dir1.txt is under dir1/ and dir6.txt is under dir6/. I have
: another directory called alldata under my home directory too.
: My question is how can I build a soft link for all those 10 text files
: (dirX.txt) under alldata/ directory by some simple command instead of link
: them one by one by hand. I am thinking of using find command b

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。