Updates:

Forums updated to SMF version 2.1.1

Delete a folder (& contents) without knowing location

Started by pooky2483, February 20, 2020, 09:30:32 PM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

pooky2483

Is it possible to delete a folder and it's contents without knowing it's location.
I need to do this to remove config files and other traces of a previously installed program so I can reinstall without the program using old config files not removed during --purge.
[img]http://imageshack.com/scaled/medium/845/l5qo.jpg[/img]
Kubuntu 18.04LTS 64bit|KDE 5.47.0|Plasma 5.12.19|QT 5.9.5|Linux 5.4.0.54-generic|M5A78L-M USB3|BIOS 2101|AMD PhenomII X4 965 3400+|P8H77-I Motherboard NIC|32.0GB PC3-10600 1333Mhz CL9 ( 9-9-9-24 ) DDR3

Keith

 If you can remember part of the directory name then one can use the find command.
Here's a test example:
mkdir mydirectory
echo "data" > mydirectory/newfile
ls mydirectory
rm -r $(find -iname *direc* )
ls mydirectory

If you can specify the whole directory name then you don't need the "-iname".  Perhaps you'll need sudo for your config file.
So to check that there is only one directory of that name:  find {directory name}
then:
rm -r {path to directory}
Works for me, anyway.

Keith