tar multiple files and directories 1

tar multiple files and directories

tar -cf myfile.tar /etc/dir1 /var/www/html /home/somedir

Here is what the above code is Doing:
1. The tar command is used to create a tar file.
2. The -c option tells tar to create a new archive.
3. The -f option tells tar to use the next argument as the name of the archive file.
4. The last arguments are the names of the files and directories to be archived.

Similar Posts