2

I know about ulimit, which is used to set the size of the maximum file size, but this setting is global on the server. Is there a way to set a limit to the file size per directory? For example, I want the maximum file size under /dir1 to be 1 MB and under /dir2 to be 2 MB.

Note: I want my settings to be independent of users/groups.

3

This is not possible, either with ulimit or otherwise. A file can have links in several directories. If a file has links in /dir1 and /dir2 and the two directories have different limits you get conflicting restrictions. For this reason any kind of limiting mechanism can only act on inodes, not on paths.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.