开发者

how to tar with a prefix directory [closed]

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜