Here is a technique to keep you from creating large files (which can
happen by accident, such as runaway programs).
To set a maximum file size, use the C shell command (usually in your
In the Korn shell and bash, use
You can change the limit from the command line, too.
For example, the csh and ksh commands below keep you from
creating any files larger than 2 megabytes:
limit filesize 2m$
ulimit -f 2000
With this command, UNIX will refuse to allocate more disk space to any file that grows larger than 2 MB.
Similarly, on Berkeley systems, you can use limit and ulimit to restrict the size of. Core dumps are generally large files and are often generated for innocuous reasons, such as invoking commands incorrectly. To set a maximum size for core dumps, execute one of these commands:
To eliminate core dumps entirely, use
0 (zero) for
Because core dumps
are essential for effective debugging, any users who are actively
debugging programs should know the commands
which removes this restriction in csh-and
ulimit -c unlimited
for bash and ksh.
- from O'Reilly & Associates' System Performance Tuning, Chapter 5