Skip to content

Instantly share code, notes, and snippets.

@wittawasw
Created February 26, 2024 12:02
Show Gist options
  • Save wittawasw/ec046e536044030215935a97d7a0da43 to your computer and use it in GitHub Desktop.
Save wittawasw/ec046e536044030215935a97d7a0da43 to your computer and use it in GitHub Desktop.
#!/bin/bash
# Go into every directory 1 level inside current directory
for dir in */; do
# Move files with extension .parquet from sub-directory to current directory
find "$dir" -maxdepth 1 -type f -name "*.parquet" -exec mv -t . {} +
done
# Rename those files by removing sub-string -parquet- from their names
for file in *.parquet; do mv "$file" "${file/-parquet-/}"; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment