Blog

Extracting zip archives with (sub)folders/images/videos into one folder (chromebook)
Created: 10 May 2021

Let's say, you have a zip archive (or zip archives) full of folders/subfolders with images, videos etc. Somehow you want to extract all that into one folder (so all the files are now in one folder), but you don't want tedious work — you want automation and results.

This tutorial assumes you have Chromebook with Linux Beta turned on, but it can also work on Debian and other distributions.

  1. Download zip archive and move it into Linux Files.

  2. Open Terminal (find it in Launcher) and run
    sudo apt install zip
    (this will install zip package if you don't have it already)

  3. Run this to unzip the archive
    unzip -d myFolder -o archive.zip "*.jpg" "*.jpeg" "*.png" "*.mp4"
    OR (if you have many zip archives)
    unzip -d myFolder -o \*.zip "*.jpg" "*.jpeg" "*.png" "*.mp4"

This way you already get a folder with your files, but you may be unsatisfied if you see multiple subfolders in each folder — really hard to work with.

  1. Run this for each file format (replace jpg) to find and copy our files to just one folder.
    find myFolder -iname '*.jpg' -exec cp '{}' myFolder/ \;

This is perfect for unzipping large archives of files, photos etc. I've also used it to nicely unzip all photos and videos from google photos takeout to be able to move to a different google account or save on your computer.