interplane.Get Omega
Read in your language

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

branch main Branches Tags History

aien-sovereign-core-mv / docs / campaigns / open-model-qwen3 / replies / 57d55864f273eb88ecbcba5a97024e50b3053b6db677077b1d8ad89d25f5e8c4.txt

50 lines · 1875 bytes Raw Blame History
1filename: docs/rename-photos.md
2```markdown
3# How to Rename a Folder of Holiday Photos with a Bash Loop
4
5This 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
8This 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
11for 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
18done
19```
20
21## Example Two: Lowercase Names
22This example converts all file names to lowercase to ensure consistency and avoid case-sensitive issues in file systems.
23
24```bash
25for 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
31done
32```
33
34## Example Three: Number the Files
35This example renames files sequentially with a number prefix, useful for creating a clean, ordered list of photos.
36
37```bash
38i=1
39for 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
46done
47```
48
49Wrap 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```