How do I exclude a file or folder while creating a tar.gz file with tar command?
How to create a tar.gz file from a folder excluding a folder
tar;compression
Simple example, creating a gzipped tarball out of a directory, excluding a subdirectory and listing the contents:$ ls fruit/apple  banana  peach  tomato$ tar czf onlyfruit.tar.gz --exclude=tomato fruit/$ tar tf onlyfruit.tar.gz fruit/fruit/peach/fruit/apple/fruit/banana/