Wednesday, February 19, 2020

[TERMINAL] - How to zip files as individual zip files


If you want to zip all files inside folder as individual zip files without extension, only need to open terminal and paste command:
for i in *; do zip "${i%%.*}" "$i"; done

Change *; to *.your_extension_file; to ignore all other file types.

ex:

open terminal and navigate to the folder (where exist the files to compress)

1. cd /Download

2. compress only text files

for i in *.txt; do zip "${i%%.*}" "$i"; done


No comments :

Post a Comment