Target a file by its inode when the filename itself is unusable or dangerous to reference. 14.02.2026 | reading time: 2 min Sometimes a filename contains strange characters or begins with a dash and conventional removal is awkward or dangerous; this short guide shows how to remove a file by its inode using standard Linux utilities so you can recover control without guessing the exact name. Locate the inode Start by discovering the inode number with tools such as `ls -i` or `stat -c %i filename`; the inode is the filesystem identifier you will pass to `find` to act on the file even if its name is problematic. Real example: remove a file named like an option ```bash $ echo secret > ./-weird $ ls -li 123456 -rw-r--r-- 1 alice users 7 Feb 14 10:00 -weird $ stat -c %i ./-weird 123456 $ find . -inum 123456 -delete $ ls -li # (no -weird entry) ``` Important behavior and safety notes Deleting by inode affects directory entries: if multiple hard links point to the same inode other names remain until all links are removed, and if a process holds the file open space is freed only after the handle closes; prefer `find . -inum <N> -maxdepth 1 -xdev -delete` for scoped operations and avoid running blanket deletes at root. Related tools worth knowing Use `lsof` or `fuser` to see processes keeping a file open, use `debugfs` (on ext filesystems) to unlink by inode at a lower level if `find` cannot, and combine `find` with `-exec` or `xargs` when you need interactive removal or complex handling. Final take and next step Deleting by inode is a precise technique for edge cases; learn it, practice it in a safe environment, and add it to your troubleshooting toolbox — to deepen Linux skills consider study toward CompTIA Linux+ or LPIC-1 with intensive preparation from bitsandbytes.academy. Join Bits & Bytes Academy First class LINUX exam preparation. filesystem utilities troubleshooting scripting