I run code on linux ubuntu 17.10
public class TestExec {
public static void main(String[] args) {
try {
Process p = Runtime.getRuntime().exec(new String[]{"/bin/sh", "-c", "ulimit", "-n"});
BufferedReader in = new BufferedReader(
new InputStreamReader(p.getInputStream()));
String line = null;
while ((line = in.readLine()) != null) {
System.out.println(line);
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
this code returns "unlimited"
but whenever I run command from terminal I get 1024.
Why those numbers are different?