Re: removing garbarge in file system by inode number...

Helge Hafting (helge.hafting@idb.hist.no)
Tue, 26 Oct 1999 11:41:37 +0200


> You can do :
>
> rm -rfi -- "????????????????????????????..."
> | | |_______ Type in the whole name (escaped or quoted).
> | |_________ Says don't interpret after this point.
> |____________ Prompt for y/N.
>
> I would redirect 'ls' to a file and edit it as a shell-script if the name
> it too long or strange. You don't need to know inodes. You can easily
> remove any named file or directory tree as long as the name in printable.
>
If using bash, consider typing
rm -rfi ???
and then press TAB. bash will now complete the filename,
and escape it properly (i.e. giving you something like rm -rf
\?\?\?\?\?.......)
You can then press enter. A properly escaped filename doesn't
match any other files, no matter how many "*"'s "?" and so on it
contains.

> Unix-101 trick: put a file called * in some newbys home directory.
>
You are too nice. Give them a file called "-fr ~/*" without quotes.
The -fr part puts it before the "-i" file some people use as a
safequard.
The ~/ part means it works from subdirectories too...

Helge Hafting

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/