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 / 464d31388ba2395ed473336669aeefb99251b6b49381fa1d78a2a060df0bf95e.txt
| 1 | filename: docs/rename-photos.md |
| 2 | --- |
| 3 | # How to Rename a Folder of Holiday Photos Using a Bash Loop |
| 4 | |
| 5 | This guide shows how to automate the renaming of a folder of holiday photos using a bash script. This is useful for organizing photos by date, making filenames more readable, or ensuring consistency across your photo library. The examples below demonstrate different renaming strategies using a simple for loop. |
| 6 | |
| 7 | ## Example One: Date Prefix |
| 8 | |
| 9 | This example adds a date prefix to each photo filename in the format `YYYY-MM-DD-`. The script assumes the photos are in a folder named `holiday-photos`. |
| 10 | |
| 11 | ```bash |
| 12 | for file in holiday-photos/*; do |
| 13 | basename=$(basename "$file") |
| 14 | newname="2023-12-25-$basename" |
| 15 | mv "$file" "$newname" |
| 16 | done |
| 17 | ``` |
| 18 | |
| 19 | ## Example Two: Lowercase Names |
| 20 | |
| 21 | This script converts all photo filenames to lowercase to ensure consistency and avoid case-sensitive issues in file systems. |
| 22 | |
| 23 | ```bash |
| 24 | for file in holiday-photos/*; do |
| 25 | basename=$(basename "$file") |
| 26 | newname=$(echo "$basename" | tr '[:upper:]' '[:lower:]') |
| 27 | mv "$file" "$newfile" |
| 28 | done |
| 29 | ``` |
| 30 | |
| 31 | ## Example Three: Number the Files |
| 32 | |
| 33 | This example renames the photos sequentially with numbers, which helps in organizing files when you want to maintain a clean order. |
| 34 | |
| 35 | ```bash |
| 36 | i=1 |
| 37 | for file in holiday-photos/*; do |
| 38 | basename=$(basename "$file") |
| 39 | newname="photo-$i.$basename" |
| 40 | mv "$file" "$newname" |
| 41 | i=$((i + 1)) |
| 42 | done |
| 43 | ``` |
| 44 | |
| 45 | Wrap Up: |
| 46 | This bash script approach saves time, reduces errors, and ensures consistent naming across holiday photos. Using loops allows for scalable and repeatable renaming. You can adapt the examples to fit your specific folder structure or naming preferences. Always test on a copy of your data first. Automation improves workflow efficiency and helps maintain organized digital photo libraries. The techniques shown here are simple yet powerful for everyday file management tasks. With just a few lines of code, you can transform messy photo folders into well-structured, searchable collections. This method is especially helpful when dealing with large volumes of holiday images. |