User Tools

Site Tools


sysadminery:bash

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
sysadminery:bash [2025/05/06 15:32] adamsysadminery:bash [2025/05/06 15:32] (current) adam
Line 2: Line 2:
 the key to memory. the key to memory. the key to memory. the key to memory. the key to memory. the key to memory.
  
-<code lang="bash"> +<code bash>
 if [ 0 ] if [ 0 ]
 then then
Line 15: Line 14:
  
 === loop over files by type === === 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
 +</code>
  
 will echo those files. be aware that you're probably going to want to enclose ''$i'' in quotes, e.g.: will echo those files. be aware that you're probably going to want to enclose ''$i'' in quotes, e.g.:
  
 +<code bash>
     for i in *.webm     for i in *.webm
     do     do
         ffmpeg -i "$i" "$i.ogg"         ffmpeg -i "$i" "$i.ogg"
     done     done
 +</code>
  
 === mass rename === === mass rename ===
Line 33: Line 35:
  
 so let's say you found a sick-awesome album. so you've done a nice ''yt-dlp -x --audio-format mp3 --split-chapters https://www.youtube.com/watch?v=aJIDqYZ7qM0''. now you got all these things that are titled like, ''this soundtrack caused me to ACTUALLY DIE and i am a GHOST now (not clickbait) link to my onlyfans in bio, music for men women children best music great music - 001 photograph [aJIDqYZ7qM0].webm'', and a ''002'', and so on. so let's say you found a sick-awesome album. so you've done a nice ''yt-dlp -x --audio-format mp3 --split-chapters https://www.youtube.com/watch?v=aJIDqYZ7qM0''. now you got all these things that are titled like, ''this soundtrack caused me to ACTUALLY DIE and i am a GHOST now (not clickbait) link to my onlyfans in bio, music for men women children best music great music - 001 photograph [aJIDqYZ7qM0].webm'', and a ''002'', and so on.
 +<code bash>
     ls | rename -d 's/ \[[^]]*\]\././'     ls | rename -d 's/ \[[^]]*\]\././'
 +</code>
 pipe ''ls'' to ''rename''. -d for "not the directory, only rename the file", and then do a sed-style replacement string.  pipe ''ls'' to ''rename''. -d for "not the directory, only rename the file", and then do a sed-style replacement string. 
  
sysadminery/bash.txt · Last modified: 2025/05/06 15:32 by adam