/ Published in: Bash
                    
                                        
I want to tar up files in directory A, but have them extract into directory B when they are untarred.
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
$ pax -w -s,/full/path/A,/full/path/B, -f /tmp/files.tar /full/path/A
$ tar -tf /tmp/files.tar
/full/path/B
/full/path/B/lib
/full/path/B/lib/bar.txt
/full/path/B/foo.txt
Comments
 Subscribe to comments
                    Subscribe to comments
                
                