Setting Ulimit

How do i set ulimit for user

Please ignore this i got it thanks.

ulimit -f is for file size

i want to check this size for all and users and print the users reached ulimit size. Please help me how to do that?

"cat /userfile | while read i; do echo -e "\n$i" ;su - "$i" -c "ulimit -f"; done"

generate the userfile with "awk -F':' '{print $1}' /etc/passwd" and remove unwanted users such as shutdown and halt

this is just for local users

I don't know what you mean with "print the users reached ulimit size"

the ulimt for filesize is the maximum size one file can have, not the sum of all files of that user

Thanks funksen,

See i set a max file size limit to some users say some 3GB and if the users reaches that limit it should send a mail to me or print those users in a log file.

hm I don't think thats possible, you could do a uid search for filesizes greater than ulimit -f minus 100mb over critical filesystems

the problem is, that the behaviour of programs that write files is different from program to program, some of them just leave the 3gb file in the directory and produce an error message, others delete the file if an error occurs

perhaps there are syslog settings that log ulimit violations