This shows you the differences between two versions of the page.
Next revision | Previous revision | ||
sysadminery:bash [2024/10/18 20:22] – created - external edit 127.0.0.1 | 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 17: | Line 34: | ||
there’s a package in apt called '' | there’s a package in apt called '' | ||
- | 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 '' | ||