# Deleting A File By It's Inode Value

**URL:** <https://linux-tips.com/t/deleting-a-file-by-its-inode-value/220>\
**Category:** Shell\
**Created:** [January 18, 2009, 12:29am UTC](https://linux-tips.com/t/deleting-a-file-by-its-inode-value/220 "2009-01-18T00:29:51Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![mike](https://linux-tips.com/user_avatar/linux-tips.com/mike/32/148_2.png) [@mike](https://linux-tips.com/u/mike)\
**Post date:** [January 18, 2009, 12:29am UTC](https://linux-tips.com/t/deleting-a-file-by-its-inode-value/220/1 "2009-01-18T00:29:51Z")

</div>

It is possible to delete a file by the it’s _inode_ value.

To test this, first create a file:

```
$ cat > '\n\n\n\n\n\n\n' 
type some text 
^D

```

To list the inode and display the characters.

```
$ ls -libt *

```

To remove by inode. Note the “–” option. This will keep any special characters in the file from being interpreted at “rm” options.

```
$ find . -inum -exec rm -- '{}' \;

```

Or to check contents

```
$ find . -inum -exec cat '{}' \;

```

Reference: [http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part2](http://www.faqs.org/ftp/usenet/news.answers/unix-faq/faq/part2)
