File search and deletion help

I am looking for a way in kde Plasma to use dolphin or some other package to:

  1. locate files 30MB or larger across an entire set of folders.
  2. Be able to selectively delete these found files . I won’t want to delete all of them just ones I choose. to.
    Not put them in a trash folder. Completely delete them.
    Thanks

You can sort files by size in Dolphin. Command line alternative:

 find * -size +30M 

Use Shift+Del or just:

rm -rf <path_to_directory>

Thanks that was a good start.
I was able to see the files that it found.
Is it possible to show the size of each file also?

I found an example of a command to also delete by using this string:

find * -name *Boogie.MP3 -exec rm -i {} \;

I can probably do *.MP3 but I would like to see the size also before I choose to delete. Just to make sure I am deleting the correct file.

This fails if the file name has a whitespace character like Blinding Lights instead of Blinding-/_Lights:

du -sh $(find * -size +30M) #to find files and size > 30M

This should also work:

rm $(find -iname "*.mp3" -size +30M) #to delete files with .mp3 extension and size > 30M

filelight is also a great GUI application for giving you a visual presentation of the
sizes of files and directories. :slight_smile:

sudo pacman -S filelight

Trying this command I get the following error.
I tried to figure it out but I don’t help on the $ option. Still learning.
Thanks for helping.

[demo@manjaro music]$ du -sh $(find * -size +30M)
du: invalid option -- '/'
du: invalid option -- 'U'
du: invalid option -- 'n'
du: invalid option -- 'n'
du: invalid option -- 'o'
du: invalid option -- 'w'
du: invalid option -- 'n'
Try 'du --help' for more information.

To have the option to completely delete a file/folder in Dolphin you first have to enable that function in the settings.

You have files with spaces, so bash is confused:

find -size +30M -print0 | xargs -0 -n1 du -sh

I guess I will mention that rm has the -i flag which means prompt before every removal.

So sometthing like

find ./ -type f -name *Boogie.mp3 -exec rm -i {} +

Where ./ is everything recursively starting from current location. You may use any path.

Example return after creating a test file with touch:

$ find ./ -type f -name *Boogie.mp3 -exec rm -i {} +
rm: remove regular empty file './Boogie.mp3'? y

So I combined some of your examples with what I think I wanted and got this:

[demo@manjaro music]$ find * -size +30M -print0  -type f -name *.MP3 -exec rm -i {} +
Beatles - Andre Gardner/Beatles Gardner 2020-04-05.mp3Beatles - Bob Malik/The Beatle Years 2016-02-28 Harrison.mp3Beatles - Chris Carter/Beatles Carter 2021-03-07 Singles.mp3Beatles - Chris Carter/Beatles Carter 2020-04-05.mp3Beatles - Joe Johnson/Beatle Brunch 2016-02-28 Color.mp3Beatles - Joe Johnson/Beatle Brunch 2020-04-04 April Fool.mp3Beatles - Les Perry/Beatles Perry 2020-04-04 April 64.mp3Beatles Michaels/Beatles Michaels 2016-03-02 Rarities.mp3Beatles Michaels/Beatles Michaels 2016-12-21 Christmas.mp3Beatles - Rob Leonard/Beatlesongs 2020-04-03.mp3Beatles - Terri Hemmert/Beatles Hemmert 2020-04-05.mp3Jeff Wayne, Richard Burton and Justin Hayward/Jeff Wayne's Musical Version of The War of the Worlds/Forever Autumn.MP3rm: remove regular file "Jeff Wayne, Richard Burton and Justin Hayward/Jeff Wayne's Musical Version of The War of the Worlds/Forever Autumn.MP3"? n

That is almost what I want.
I would like it to stop and ask at each file name it finds and show me the actual size of the file it found.