This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
sysadminery:bash [2025/04/27 15:47] – adam | sysadminery:bash [2025/06/06 07:05] (current) – external edit 127.0.0.1 | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | === loop over files by type === | + | === repetition is the key to memory |
+ | the key to memory. the key to memory. the key to memory. | ||
+ | <code bash> | ||
+ | if [ 0 ] | ||
+ | then | ||
+ | echo " | ||
+ | else | ||
+ | echo " | ||
+ | fi | ||
+ | </ | ||
+ | |||
+ | it makes sense in the context of "if this program runs without error" | ||
+ | |||
+ | === loop over files by type === | ||
+ | <code bash> | ||
for i in in *.webm | for i in in *.webm | ||
do | do | ||
echo $i | echo $i | ||
done | done | ||
+ | </ | ||
will echo those files. be aware that you're probably going to want to enclose '' | will echo those files. be aware that you're probably going to want to enclose '' | ||
+ | <code bash> | ||
for i in *.webm | for i in *.webm | ||
do | do | ||
ffmpeg -i " | ffmpeg -i " | ||
done | done | ||
+ | </ | ||
=== mass rename === | === mass rename === | ||
Line 18: | Line 35: | ||
so let's say you found a sick-awesome album. so you've done a nice '' | so let's say you found a sick-awesome album. so you've done a nice '' | ||
+ | <code bash> | ||
ls | rename -d 's/ \[[^]]*\]\./ | ls | rename -d 's/ \[[^]]*\]\./ | ||
+ | </ | ||
pipe '' | pipe '' | ||