Exclude directory from tar
Exclude directory from tar.
Some times we need to omit some directories while taking tar if it’s a large files or unwanted ones. Let’s see how we can exclude directory from tar.
tar is used to compress the files and directories.
Eg: If you want to create a tar of your public_html.then
Now let’s see how to exclude a directory, using –exclude=’your_directory’
Eg: I need to exclude a directory called uploadimg from public_html.
FYI : In the above command I have excluded the directory uploadimg and created the tar of my public_html, The public_html files will stored in the name of public_html-new.tar.gz
Make sense ? Any doubts let me know.