Last active
April 30, 2016 19:23
-
-
Save kwharrigan/31d38aed44311cd5f96c35fd472bf604 to your computer and use it in GitHub Desktop.
Play around with inode allocation
This file contains 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
# 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