Y
Y
YaroslavKleyno2018-09-22 04:02:40
linux
YaroslavKleyno, 2018-09-22 04:02:40

Awk how to parse output?

Good day!
It so happened that at work I have 10 petabytes of information, I need to identify video files with a bit rate> 30 megabits in this array and delete them!
How I played:
find . -not -name "*.wav" -not -name "*.png" -not -name "*.info" -not -name "*.wav.1" -not -name "*.mp3" -not - type d -type f -printf "%P " -exec mediainfo --Output='Video;%BitRate/String%' {} \;
!!!RENDER!!!/OUT/107_0286_03.MP4 4,514 b/s
!!!RENDER!!!/OUT/107_0286_04.MP4 4,514 b/s
!!!RENDER!!!/OUT/001-379. MP4 10 000 kb/s
!!!RENDER!!!/OUT/Camera 3_41.MP4 10 000 kb/s
!!!RENDER!!!/OUT/Camera 4_43.MP4 10 000 kb/s
!!!RENDER!! !/OUT/Camera 4_44.MP4 10 000 kb/s
!!!RENDER!!!
!!!RENDER!!!/OUT/Camera 2_39.MP4 10 000 kb/s
!!!RENDER!!!/OUT/Camera 1_41.MP4 10 000 kb/s
!!!RENDER!!!/OUT/Camera 4_45 .MP4 10 000 kb/s
What I achieved the most:
[email protected]:/media/40# find . -not -name "*.wav" -not -name "*.png" -not -name "*.info" -not -name "*.wav.1" -not -name "*.mp3" -not - type d -type f -printf "%P " -exec mediainfo --Output='Video;%BitRate/String%' {} \; | awk '{print$(NF-2)$(NF-1)}'
4514
4514
10000
10000
10000
10000
I need to display full paths (up to dot + extension) and if bitrate > 30000 delete files.
Tell me how to implement?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question