![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hello
I need help with tar. I want to create a tar archive and compress it at one operation. I want also to exclude some subdirectories from a directory which is archived. For example I need to archive the /aaa/bbb/ccc directory and create the ccc.tar.gz file. But I don't want the /aaa/bbb/ccc/ddd directory to be archived. Is it possible to that all issues at once in one command? Regards, Pit |
|
||||
|
You can probably chain a list of commands together.
If you know which files and directories to tar, it will be much easier. On solaris you can tar and compress using cd /aaa/bbb; tar cvf - ./<ccc> | gzip - ccc.tar.gz use -X to exclude directories, and -l for file list, whatever is more convenient for you. on AIX replace gzip with compress (you will get a .Z file instead) on AIX you only have -L to include the file list. Obviously if you have a file list and know which directories to exclude you can type them in before hand and have a short one-liner. Otherwise you may need a loop using ls and check for a directory and >> to the exclude file before you perform your tar. |
| Sponsored Links | ||
|
|
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|