aien-sovereign-core-mv
AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination.
Brought by drakestapleton
aien-sovereign-core-mv / docs / campaigns / open-model-qwen3 / replies / 57d55864f273eb88ecbcba5a97024e50b3053b6db677077b1d8ad89d25f5e8c4.txt
| 1 | filename: docs/rename-photos.md |
| 2 | ```markdown |
| 3 | # How to Rename a Folder of Holiday Photos with a Bash Loop |
| 4 | |
| 5 | This guide shows how to automate the renaming of a folder of holiday photos using a bash loop. This is useful for organizing photos by date, making them easier to find, or preparing them for upload. The process involves iterating over files and applying a naming convention using shell scripting. |
| 6 | |
| 7 | ## Example One: Date Prefix |
| 8 | This example adds a date prefix to each photo file in the format YYYY-MM-DD. The script assumes the files are in a folder named "holiday_photos". |
| 9 | |
| 10 | ```bash |
| 11 | for file in holiday_photos/*; do |
| 12 | if [[ -f "$file" ]]; then |
| 13 | filename=$(basename "$file") |
| 14 | date_prefix=$(date -d "2023-12-25" +%Y-%m-%d) |
| 15 | new_name="${date_prefix}_${filename}" |
| 16 | mv "$file" "$new_name" |
| 17 | fi |
| 18 | done |
| 19 | ``` |
| 20 | |
| 21 | ## Example Two: Lowercase Names |
| 22 | This example converts all file names to lowercase to ensure consistency and avoid case-sensitive issues in file systems. |
| 23 | |
| 24 | ```bash |
| 25 | for file in holiday_photos/*; do |
| 26 | if [[ -f "$file" ]]; then |
| 27 | filename=$(basename "$file") |
| 28 | new_name=$(echo "$filename" | tr '[:upper:]' '[:lower:]') |
| 29 | mv "$file" "$new_name" |
| 30 | fi |
| 31 | done |
| 32 | ``` |
| 33 | |
| 34 | ## Example Three: Number the Files |
| 35 | This example renames files sequentially with a number prefix, useful for creating a clean, ordered list of photos. |
| 36 | |
| 37 | ```bash |
| 38 | i=1 |
| 39 | for file in holiday_photos/*; do |
| 40 | if [[ -f "$file" ]]; then |
| 41 | filename=$(basename "$file") |
| 42 | new_name="photo_${i}_${filename}" |
| 43 | mv "$file" "$new_name" |
| 44 | i=$((i + 1)) |
| 45 | fi |
| 46 | done |
| 47 | ``` |
| 48 | |
| 49 | Wrap Up: This bash script efficiently organizes holiday photos using automation, improves file naming consistency, and saves time when managing large photo collections. It's simple to adapt, reliable for daily use, and ensures files are properly renamed with clear, predictable patterns. |
| 50 | ``` |