Skip to content

Useful MacOS Terminal Commands

Unzipping all archives in a folder

To unzip all .zip files in a folder, you can use the following command:

for i in *.zip; do unzip "$i" -d "${i%%.zip}"; done

Deleting all but a few files

To delete all files and folders except for files with a .zip extension, you can use the following command:

find . ! -name "*.zip" -delete