开发者

how to tar with a prefix directory [closed]

开发者 https://www.devze.com 2023-02-14 07:55 出处:网络
Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow.
Closed. This question is off-topic. It is not currently accepting answers.

Want to improve this question? Update the question so it's on-topic for Stack Overflow.

Closed 11 years ago.

开发者_StackOverflow Improve this question

I want to tar the directory /opt/mydir into a directory /opt/myprefix/mydir

how can I do that with tar command? (solaris)

thanks


Create a symlink so that you can access /opt/mydir as /opt/myprefix/mydir

cd /opt
ln -s . myprefix

Then tar it:

tar -cvf mytar.tar /opt/myprefix/mydir
0

精彩评论

暂无评论...
验证码 换一张
取 消