Is the following a known and long-standing inconsistency/feature of tar? I suspect the answer is yes.
cd mydir
tar cvpf dec14.tar .
tar xvpf dec14.tar -C .
Files are extracted to where they are supposed to be.
cd ..
tar cvpf dec14.tar mydir
tar xvpf dec14.tar -C mydir
Files are restored nested in mydir/mydir, in ot开发者_JAVA百科her words, nested one level lower than before.
No, it's not an inconsistency or bug. 'tar' is doing exactly what you told it to do. The '-C' option just means to change into the given directory first, it doesn't imply anything about trimming that string off the extracted paths.
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论