This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| generic_linux_commands [2026/03/25 13:02] – admin | generic_linux_commands [2026/03/25 14:01] (current) – admin | ||
|---|---|---|---|
| Line 38: | Line 38: | ||
| - Standard: s/^\(.*\), The \(.*\)$/The \1 \2/ — captures everything before , The as \1 and everything after as \2, then prepends The | - Standard: s/^\(.*\), The \(.*\)$/The \1 \2/ — captures everything before , The as \1 and everything after as \2, then prepends The | ||
| - Combo pack: s/\(+ \)\(.*\), The \(.*\)/ | - Combo pack: s/\(+ \)\(.*\), The \(.*\)/ | ||
| + | |||
| + | ===== RENAME ' | ||
| + | Dry-run preview: | ||
| + | < | ||
| + | find / | ||
| + | dir=$(dirname " | ||
| + | filename=$(basename " | ||
| + | newname=$(echo " | ||
| + | echo "' | ||
| + | echo " | ||
| + | done | ||
| + | </ | ||
| + | |||
| + | Execute renames: | ||
| + | < | ||
| + | find / | ||
| + | dir=$(dirname " | ||
| + | filename=$(basename " | ||
| + | newname=$(echo " | ||
| + | if [ " | ||
| + | mv -- " | ||
| + | echo " | ||
| + | fi | ||
| + | done | ||
| + | </ | ||
| + | |||
| + | Key sed pattern: | ||
| + | - s/^\(.*\), \(An\{0, | ||