Last active
December 12, 2020 16:01
-
-
Save MadhavJivrajani/e632b28a580304c4c0dbc1f88234261b to your computer and use it in GitHub Desktop.
Scripts to get inode numbers of each file in a directory
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# gets inode numbers of all files in a directory (recursive) | |
find . -type f | awk '{print $NF | "xargs stat" }' | awk '/File/{file=$2} /Inode/ {print file, "Inode: " $4}' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# gets inode numbers of files only in the current level, non-recursive | |
find . -maxdepth 1 -type f | awk '{print $NF | "xargs stat" }' | awk '/File/{file=$2} /Inode/ {print file, "Inode: " $4}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment