If the files have no spaces in their names
- Code: Select all
FILES=$(ls -1 *.jpg)
tar cf somearchive.tar $FILES
rm -f $FILES
Zip is a DOS/Windows archive format, universal but not particularly good compression. Tar creates uncompressed archives. gzip, bzip2 and xz compress single files or streams and are using in conjunction with tar to produce compressed archives.
However, JPEG files are also compressed and are likely to expand when further compression is attempted, so plain tar is the sensible choice.
"Insanity: doing the same thing over and over again and expecting different results." (Albert Einstein)