shell hack - inode table full

956 단어 shell
shell hack - inode table full
 
a shell script, that create folder recusively,
it don't take much disk space, but it will use up inode table, after that you can't create new folder/file,
 
play it, but don't fucked yourself with it ...
------
code
 
    hack_inode_full.sh:
 
#! /bin/bash

# a bad and malicious program to create folder recursively,
# if you change the loop to infinite, then it will use up the inode of disk, and it is so deep recurisive that you can't even use 'rm -rf' to remove the folder,you can only write another program to remove folder from inner to top,

# define the deepth
declare n=5

echo -e "total deep:\t $n"
cd /tmp

while [ $n -gt 0 ];do
	mkdir adir
	cd adir
	touch afile
	n=$(($n-1))
done

exit 0
 
------

좋은 웹페이지 즐겨찾기