I think I have a program that creates countless forks of itself (not intentionally, I hope).
I like to test this but I can't kill the machine, so how could I limit the number of process to execute this in a sage way?
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. It only takes a minute to sign up.Sign up to join this community
ulimit is used to temporarily establish limits to the current shell and its sons.
You can limit the number of process with
ulimit -u $desired_number
More info in
man ulimit and
e.g. User1 to 20
user1 hard nproc 20
e.g. group1 to 50
@group1 hard nproc 50