Want to limit the size of any files that can be created? Use this guy: ulimit
ulimit is a built-in Linux shell command, that allows viewing or limiting system resource amounts - that invidual users consume.
Per the man page, the syntax for the command is as follows:
ulimit [-HS] [options [limit]]
So, if you wanted to limit the size of any file that can be created to 2KB, the following command will get the job done:
$ ulimit -f 2
Any attempt to create a file beyond the size of 2KB, and you will be greeted with the following polite message: File size limit exceeded (core dumped)
There are other resources that this wonderful command can place a limit on. A great tool to prevent deliberate misbehaviors, or inadvertent usage.
Nice..Thanks for sharing..!
Red Hat
Learning Community
A collaborative learning environment, enabling open source skill development.