tar all files to subfolder code example Example: tar all files and subdirectories tar -zcvf my.tar.gz path-of-directory/