Skip to content

Instantly share code, notes, and snippets.

@snipsnipsnip
Last active August 29, 2015 14:06
Show Gist options
  • Save snipsnipsnip/7b8f6c711f21de9826b4 to your computer and use it in GitHub Desktop.
Save snipsnipsnip/7b8f6c711f21de9826b4 to your computer and use it in GitHub Desktop.
lookup-inode.sh: inode番号からディレクトリ名を逆引き
#!/bin/sh
# taken from http://unix.stackexchange.com/questions/35292/quickly-find-which-files-belongs-to-a-specific-inode-number
if [ "$1" ] && [ "$2" ]; then
exec sudo debugfs -R "ncheck $2" "$1" 2> /dev/null
else
echo "usage: $0 device inode-number"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment