Unix tar command to zip/compress multiple folders and files at same time.

Unix has the facility that we can use to zip or tar the folders and files on your web site. You can download them to your computer as backups.

To tar single folder:

tar cvf folder1.tar folder1

To tar multiple folders (in current directory):

tar cvf folders.tar folder1 folder2 folder3

To tar multiple folders (in different directories):

tar cvf folders.tar /path/to/folder1 /path/to/folder2 /path/to/folder3

To tar single file:

tar cvf file.tar file1.php

To tar multiple files (in current directory):

tar cvf files.tar file1.php file2.txt file3.html

To tar multiple files (in different directories):

tar cvf files.tar /path/to/file1.php /path/to/file2.txt /path/to/file3.html

.

Related Posts:

  • No Related Posts
One comment on “Unix tar command to zip/compress multiple folders and files at same time.
  1. I’m extremely impressed with your writing skills and also with the layout on your blog. Is this a paid theme or did you customize it yourself? Anyway keep up the excellent quality writing, it is rare to see a great blog like this one these days.

Comments are closed.