On Fri, 27 Apr 2007 09:50:56 +1200 Roger Searle <[EMAIL PROTECTED]> wrote:
> I think I recall a posting about this or similar recently but can't find > it, I hope this provides a clear explanation of what I want to achieve. > If I have a tar file that has a few levels of folders before getting to > the actual data - for example > '/toplevel/subfolder/next/another/lastfolder/files-here' and the top 4 > levels of folders are all empty. > > Then extract the files from the tar file to my home directory I would > get the files in /home/roger/toplevel/subfolder/next/another/lastfolder/. > > Is there a command to take out 4 levels of folders from this structure > so the files go into /home/roger/lastfolder? Either during or after > extracting from the tarfile? cd /home/roger/toplevel/subfolder/next/another mv lastfolder ../../.. is bulletproof and will even work with Solaris tar.