One command to zip them all

script
Author

Thang V. Pham

Published

February 15, 2025

To upload timsTOF data to ProteomeXchange, we have to create a single file for each .d data folder. One can zip each folder by right-click and send-to a compressed zipped folder. For tens or hundreds of folders, that process is tedious.

I previously used tar in a Unix command line for file in *.d; do tar cvf $file.tar $file; done. But that requires a Unix-like system like Cygwin installed on your Windows machine.

It turns out that tar is also available on Windows 10/11! If you want to zip all timsTOF .d data folders, open a command prompt, go to the folder containing all the .d folders, and type

for /d %v in (*.d) do tar.exe -a -c -v -f "%v.zip" "%v"

You can place the command in a batch file (use %% in place of %). Or just download zippy.bat to where the .d data folders are and run it.

Enjoy.