Next: Compression
Up: Working with Files
Previous: File operations
The tar command will pack multiple files in a single file - this is
useful for subsequent compression and for file transfer; e.g. to zip
up and move an entire directory you can use tar, gzip and then scp
(secure copy for copying between UNIX machines)
- Tar and zip all in one step:
- >tar cvzf file.tgz name_of_files_or_directories
- use scp to move /tmp/file.tar.gz to another location
- locally, >tar xvzf file.tgz
- Or do it separately
- >tar cvf /tmp/file.tar name_of_files_or_directories
- >gzip /tmp/file.tar
- use scp to move /tmp/file.tar.gz to another location
- locally, >gunzip file.tar.gz; tar xvf file.tar
Chris Paciorek
2006-04-02