Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I'm trying to move IMAPed files from my old mail server to the new one. I began by tarring my old mail directory:
tar cvf kmurrah.tar /home/vmail/kmurrah@usseryprinting.com/*
then moved the file to the new mail server. Then I uncompressed it by going to /home/kmurrah and using
tar xvf kmurrah.tar
problem is, I now have the files untarred at /home/kmurrah/home/vmail/kmurrah@usseryprinting.com and there are so many of them, I can't cp them to the folder I want them in.
So, my question is this: is there a command I can use in either tarring or untarring that allows me to put the files in the directory I want? that is, so that the files can be untarred "loose" into whatever folder I want them in, not inside another folder?
The "strip-components 3" tells it to remove the 3 leading directories from the filename. Note on older GNU tar it was --strip-path instead of --strip-components.
FYI type "man tar" for full details of its usage including the above.
Last edited by MensaWater; 12-05-2006 at 10:11 AM.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.