Skip to content

Instantly share code, notes, and snippets.

@kwharrigan kwharrigan/inode_test.sh
Last active Apr 30, 2016

Embed
What would you like to do?
Play around with inode allocation
# Example 1 - Remove file after every iteration... note inodes are
# often reused after each deletion
for i in {1..1000}; do
filename=/tmp/file$i
echo "Creating " $filename
echo "blahblah" > $filename
stat -c "%i" $filename
echo "Removing " $filename
rm $filename
done
# Example 2 - Create files, but don't remove until the end. Note inodes not often reused
for i in {1..1000}; do
filename=/tmp/file$i
echo "Creating " $filename
echo "blahblah" > $filename
stat -c "%i" $filename
done
for i in {1..1000}; do
filename=/tmp/file$i
rm $filename
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.