How to delete all files owned by root

I have in antiX26, a misbehaving live-iso-maker that leaves about 50 scratch files in my home directory after it finishes.
Sometimes it cleans up, other times it leaves rubbish, it is intermittant.

The file names are a collage of names. It would be difficult to select them by name … unless I made a list
but
their common feature is they are all owned by root, whereas all other files in my directory are owned by nevj.

So is it possible to write an rm command that deletes only root owned files? … and it would have to avoid deleting .. which is the parent directory.

I think your goal can be reached combining find, xargs and rm.
According to find ( https://www.cyberciti.biz/faq/how-do-i-find-all-the-files-owned-by-a-particular-user-or-group/ ) this should be possible:

find $HOME -user root

That looks for root owned files in your home.
Inspect what it outputs, and treat it as a dry run.
If it produces a list you expect, run it with the delete command:
find $HOME -user root -print0 | xargs rm

You will be able finish the real command, this just an idea…

It works… That is brilliant, thanks Laszlo.
Did not think of using find

Yeah what @kovacslt suggested - except “print0” and xargs are quite possibly redundant?

simple
find $HOME -type f -user root
verify the output above - then :
find $HOME -type f -user root -exec rm {} \;

I will try your version. Thanks.
I am afraid I have already given Laszlo the solution.

Have you noticed, when a solution is given, the topic closes in 2 days?
I think a week maybe… people have afterthoughts.

No, not redundant. It creates a more adequate output for xargs in case some of the file names contain spaces.

But the -exec really replaces xargs.

Some versions of find also have a --delete option.

It is a weird set of filenames

$ ls -l
total 52
-rw-r--r-- 1 root root    0 May 21 20:43  +
-rw-r--r-- 1 root root    0 May 21 20:43  1
-rw-r--r-- 1 root root    0 May 21 20:43  10
-rw-r--r-- 1 root root    0 May 21 20:43  10.irs
-rw-r--r-- 1 root root    0 May 21 20:43 '((128K'
-rw-r--r-- 1 root root    0 May 21 20:43  1.Default.irs
-rw-r--r-- 1 root root    0 May 21 20:43  1.Music.irs
-rw-r--r-- 1 root root    0 May 21 20:43  +20
-rw-r--r-- 1 root root    0 May 21 20:43  2.json
-rw-r--r-- 1 root root    0 May 21 20:43  2.Stereo
-rw-r--r-- 1 root root    0 May 21 20:43 '((48k'
-rw-r--r-- 1 root root    0 May 21 20:43 '((48kHz'
-rw-r--r-- 1 root root    0 May 21 20:43  4.Music
-rw-r--r-- 1 root root    0 May 21 20:43  ATMOS
-rw-r--r-- 1 root root    0 May 21 20:43  Audio
-rw-r--r-- 1 root root    0 May 21 20:43  AudioWizard
-rw-r--r-- 1 root root    0 May 21 20:43  Auto
-rw-r--r-- 1 root root    0 May 21 20:43  bass.irs
-rw-r--r-- 1 root root    0 May 21 20:43  Beats
-rw-r--r-- 1 root root    0 May 21 20:43  beyerT1.irs
-rw-r--r-- 1 root root    0 May 21 20:43  Boosted.json
-rw-r--r-- 1 root root    0 May 21 20:43  Compensation.json
-rw-r--r-- 1 root root    0 May 21 20:43  Crystalizer
drwxr-xr-x 2 nevj nevj 4096 May 10 21:22  Desktop
drwxr-xr-x 2 nevj nevj 4096 May  3 21:48  Documents
drwxr-xr-x 2 nevj nevj 4096 May  3 21:48  Downloads
-rw-r--r-- 1 root root    0 May 21 20:43  Earpods
-rw-r--r-- 1 root root    0 May 21 20:43  Enhancing
-rw-r--r-- 1 root root    0 May 21 20:43  EQ.json
-rw-r--r-- 1 root root    0 May 21 20:43  Expand
-rw-r--r-- 1 root root    0 May 21 20:43  Gain
-rw-r--r-- 1 root root    0 May 21 20:43  Gain.json
-rw-r--r-- 1 root root    0 May 21 20:43  HIFI.irs
-rw-rw-r-- 1 nevj nevj 1281 May  4 20:19  installissue
-rw-r--r-- 1 root root    0 May 21 20:43  Intelligibility
-rw-r--r-- 1 root root    0 May 21 20:43  Intelligibility.json
drwx------ 4 root root 4096 May 21 20:45  iso-snapshot-NlTeXoEy
-rw-r--r-- 1 root root    0 May 21 20:43  Loudness
-rw-rw-r-- 1 nevj nevj 2504 May 20 21:36  makingiso
-rw-rw-r-- 1 nevj nevj 2505 May 21 20:11  makingiso2
-rw-rw-r-- 1 nevj nevj 2504 May 21 20:48  makingiso3
-rw-rw-r-- 1 nevj nevj 9199 May 12 20:14  makingliveusb
-rw-r--r-- 1 root root    0 May 21 20:43  MaxxAudio
-rw-r--r-- 1 root root    0 May 21 20:43  MaxxSpace.irs
-rw-r--r-- 1 root root    0 May 21 20:43  MDR-E9LP
-rw-r--r-- 1 root root    0 May 21 20:43  MDR-XB500
-rw-r--r-- 1 root root    0 May 21 20:43 'MP3))'
-rw-r--r-- 1 root root    0 May 21 20:43  only.json
-rw-r--r-- 1 root root    0 May 21 20:43  Perfect
drwxr-xr-x 2 nevj nevj 4096 May  3 21:48  Pictures
-rw-r--r-- 1 root root    0 May 21 20:43  Pro
-rw-r--r-- 1 root root    0 May 21 20:43  SM
-rw-r--r-- 1 root root    0 May 21 20:43  SRH940.irs
-rw-r--r-- 1 root root    0 May 21 20:43  Surround
-rw-r--r-- 1 root root    0 May 21 20:43 '(thin).json'
drwxr-xr-x 2 nevj nevj 4096 May  3 21:48  Videos
-rw-r--r-- 1 root root    0 May 21 20:43  w
-rw-r--r-- 1 root root    0 May 21 20:43  XBA3.irs
-rw-r--r-- 1 root root    0 May 21 20:43  XBA4.irs
-rw-r--r-- 1 root root    0 May 21 20:43  XBA-H3
-rw-r--r-- 1 root root    0 May 21 20:43  X-Fi
-rw-r--r-- 1 root root    0 May 21 20:43 'Z.E.))'
-rw-r--r-- 1 root root    0 May 21 20:43 '((Z-Edition))'
-rw-r--r-- 1 root root    0 May 21 20:43 'Z-Edition))'
-rw-r--r-- 1 root root    0 May 21 20:43 '((Z-Edition)).irs'

There are no blanks, but there are quotes
I have discovered that I can configure the iso-maker to use something other than my home directory as its scratch space. … it has to be somewhere that will not end up on the .iso file. Perhaps a subdir in my home directory?