Thursday, August 23, 2007

Limit User's File Size -- UNIX

If you are hurting for disk space, you might want to look into limiting the file size a user can create. Depending on the shell, you can do this by using either limit or ulimit command -- add to a user's initialization file to make permanent. Here are a few examples.

# sh
# ulimit -f 5000
# mkfile 6m MB
File Size Limit Exceeded - core dumped

# ksh
# ulimit -f 5000
# mkfile 6m MB
File Size Limit Exceeded(coredump)

# csh
# limit filesize 5m
# mkfile 6m MB
File Size Limit Exceeded (core dumped)

# bash
# ulimit -f 5000
# mkfile 6m MB
File Size Limit Exceeded (core dumped)

1 comment:

Anonymous said...

Hi Friends,

I Find Absolutely FREE PlayBoy & Penthouse:

http://www.oxpe.net/playboy/

If I find something else I'll inform you.

Best Regards,
Vera