Post B2ixGL8qHSX27RiWw4 by miles@snug.moe
(DIR) More posts by miles@snug.moe
(DIR) Post #B2ixGJYIBrhXBnbpKK by miles@snug.moe
2026-01-27T20:54:59.376Z
1 likes, 1 repeats
Is there any better one-liner to achieve what this does? /genfind . -name '*.zip' -exec sh -c "unzip \"{}\" -d \"\$(basename \"{}\" .zip)\"" \;
(DIR) Post #B2ixGL8qHSX27RiWw4 by miles@snug.moe
2026-01-27T21:56:55.887Z
0 likes, 0 repeats
find . -name '*.flac' -exec sh -c 'ffmpeg -i "{}" -ab 192k -map_metadata 0 -id3v2_version 3 -write_id3v1 1 "$(echo "{}" | sed -e "s/.flac\$//")"_192kbps.mp3' \;:neocat_googly_woozy:
(DIR) Post #B2ixGM0j37dKoYvYvI by WildPowerHammer@mastodon.ml
2026-01-27T22:23:32Z
0 likes, 0 repeats
@miles i wrote this a bit unholy thing for myself and now i use it to convert flac to ogg, flac to mp3, mp3 to ogg... png stickerpacks to webp.... basically anything that is supported by ffmpeg... i love ffmpeg :neocat_floof_googly_woozy:
(DIR) Post #B2ixGN2XDsfu0SmWNk by yura@udongein.xyz
2026-01-27T22:28:09.308297Z
0 likes, 0 repeats
@WildPowerHammer @miles out of curiosity, why doesn't "ffmpeg -i file.flac file.mp3file.mp3" work for you? :akko_mmh:
(DIR) Post #B2iyCcQq9ai4XWvQ6C by purple@nya.social
2026-01-27T22:36:52.073Z
0 likes, 0 repeats
@miles@snug.moe the subshell is unnecessary since you're running a single command (even though we use command expansion to get the basename). find blah -exec unzip "{}" -d "$(basename "{}".zip)" ;
(DIR) Post #B2iyCdq2vMSytzj41g by mischievoustomato@tsundere.love
2026-01-27T22:39:03.502826Z
0 likes, 0 repeats
@purple @miles also i think -execdir is preferred due to security or something like that oever -exec
(DIR) Post #B2iyLjjqMEcjo5A4f2 by purple@nya.social
2026-01-27T22:40:07.457Z
1 likes, 0 repeats
@mischievoustomato@tsundere.love @miles@snug.moe yeah good lookin, "Like -exec, but the specified command is run from the subdirectory containing the matched file, which is not normally the directory in which you started find" it would probably save a call to basename unless this port wine is stronger than it smells
(DIR) Post #B2iznLy8QRKk9KZwIq by miles@snug.moe
2026-01-27T22:56:26.788Z
1 likes, 0 repeats
@purple @mischievoustomato I use basename mostly to remove the file suffix (note the space between {} and .zip). I could replace it with sed or something like that yeah.-execdir is new to me, thanks :3
(DIR) Post #B2izocaS7qKXyl6drE by mischievoustomato@tsundere.love
2026-01-27T22:57:10.110977Z
0 likes, 0 repeats
@miles @purple im so lazy and didn't know of basename so I just added to the filename lmfao