Eu tenho um diretório dentro de si. Como faço para excluí-lo.
~/.local/share/Trash/files$ ls devices/
reg-dummy
~/.local/share/Trash/files$ ls devices/reg-dummy/
subsystem
~/.local/share/Trash/files$ ls devices/reg-dummy/subsystem/
devices
Além disso
~/.local/share/Trash/files$ find devices/ | head -n 20
devices/
devices/reg-dummy
devices/reg-dummy/subsystem
devices/reg-dummy/subsystem/devices
devices/reg-dummy/subsystem/devices/reg-dummy
devices/reg-dummy/subsystem/devices/reg-dummy/subsystem
devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices
devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy
devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem
devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices
devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy
devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem
devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices
devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy
devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem
devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices
devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy
devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem
devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices
devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy/subsystem/devices/reg-dummy
Além disso, embora meu cérebro não consiga resolver o problema da parada, parece que sudo rm -rf devices
continua para sempre sem produzir resultados.
~/.local/share/Trash/files$ sudo rm -rf devices
^C~/.local/share/Trash/files$
A mesma coisa para perl -e 'use File::Path qw(remove_tree); remove_tree("$ENV{HOME}/.local/share/Trash/files/devices")'
. A mesma coisa para du -s devices/
. A mesma coisa para du -sch ~/.local/share/Trash/
outros comandos
$ cd ~/.local/share/Trash/files/devices/reg-dummy/subsystem/devices/
$ ls -ldi
8131921 drwxr-xr-x 3 theking theking 4096 Mar 17 19:43 .
$ cd reg-dummy/subsystem/devices/
$ ls -dli
8131926 drwxr-xr-x 3 theking theking 4096 Mar 17 19:43 .
$ find .local/share/Trash/files/ -maxdepth 1 -delete
find: cannot delete `.local/share/Trash/files/devices': Directory not empty
find: cannot delete `.local/share/Trash/files/': Directory not empty
Não quero que fique preso no meu lixo para sempre!
Nota: Eu estava fazendo um backup bruto de um computador simplesmente usando scp
, mas fiquei sem espaço e isso aconteceu.
ls -dli devices
els -dli devices/reg-dummy/subsystem/devices/
ls -ldi devices
, não device
. Estou tentando ver se esses são realmente links físicos (o mesmo inode). No entanto, esteja ciente de que, se este for um diretório grande, rm -rf
levará muito tempo, mas eventualmente funcionará. Se o problema aqui for links circulares, você receberá uma mensagem de erro sobre recursão infinita. Se não houver mensagem de erro, basta rm -rf
seguir seu curso.
rm -rf devices
faz?