Set Max File Size System Wide – All Users – Ubuntu

Monday, August 18th, 2025

Set Max File Size System Wide – All Users – Ubuntu

Sometimes, a game server process can crash continually until it is manually restarted.  When this happens, the log file it creates fills up with the same error until the ENTIRE server runs out of disk space.  To prevent that from happening, limit the maximum size a file can grow to by adding the following line to the end of the /etc/profile file to apply it to all users.

ulimit -f 52428800

The above numeric value is kilobytes.  It is set to 50GB in the command above.

Restart the server for it to take effect.