singh101
asked on
How to use the tar command to tar up a directory
I have a directory called webapps, all the contents i need to compress into a tar file. How can I do this? Should I use tar or gzip which is the better solution?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
tar -zcf webapps.tar.gz webapps
when I run this command it is returning tar: z unknown function modifier. ideally I want to tar up the contents of webapps and not the webapps folder. If I cd to webapps and then replace . with webapps. Is that ok?
when I run this command it is returning tar: z unknown function modifier. ideally I want to tar up the contents of webapps and not the webapps folder. If I cd to webapps and then replace . with webapps. Is that ok?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
$ tar -zcf webapps.tar.gz webapps
$ tar -jcf webapps.tar.bz2 webapps
These commands assume that your current folder is one level upper that your 'webapps' folder