DJ
06-05-2001, 11:56 AM
Hi all,
I need to know the command to tar & untar a folder with the file permission intact thru TELNET.
Thanks
I need to know the command to tar & untar a folder with the file permission intact thru TELNET.
Thanks
![]() | View Full Version : Help needed DJ 06-05-2001, 11:56 AM Hi all, I need to know the command to tar & untar a folder with the file permission intact thru TELNET. Thanks bert 06-05-2001, 12:28 PM Originally posted by DJ Hi all, I need to know the command to tar & untar a folder with the file permission intact thru TELNET. Thanks What OS? DJ 06-05-2001, 12:31 PM Sorry, forget to mention it is UNIX thanks bert 06-05-2001, 12:32 PM I know it is Unix, but what is it? Redhat, BSD ? bert 06-05-2001, 12:39 PM This should work: tar -xvf yourfile.tar This will extract the file in the current directory. Permissions should be kept intact, however, this is not true for every OS. I would just set the permissions any way. You can just change the permissions using chmod. Hope this helps! :) DJ 06-05-2001, 01:04 PM Sorry again. It is RedHat. There is too many files with all sort of permission thus i would not want to CHMOD again. Any help would be greatly appreciated :) bert 06-05-2001, 01:22 PM There is really nothing you can do that I am aware of that will preserve permissions. Permissions should be preserved by default. I am not sure though if Redhat will do that, otherwise you will need to chmod them again. Wazeh 06-05-2001, 08:42 PM DJ, first you have to be one level above the directory you want to tar. For example, if you want to tar foo/bar, then you will be in foo and type the following: tar -cvf bar.tar bar This will create the archive bar.tar. To untar it, you will be again in foo, and type this: tar -xvpf bar.tar Notice the 'p' which tells tar explicitly to keep permissions intact while extracting. I hope this helps a bit bert 06-05-2001, 11:41 PM Thanks Wazeh for helping out. I didn't know the p would do that! :) ComplexMind 06-06-2001, 10:35 AM It doesn't answer the original question, but most of these 'How do I use foobar command under *NIX' can be answered using the 'man' system (short for manual). At a command line simply type: man <command> or in this case man tar HINT: Use cursors to scroll, 'q' to quit ;) Use the manuals! They are [usually] your friends :cool: HTH |