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.
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…
$ 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?