import java.io.*;
public class testprog

{


public static void main(String args[]) throws IOException, InterruptedException
{       

        String command="find BEL/ -type f | wc -l";
        Process p=Runtime.getRuntime().exec(command);
        p.waitFor();
        BufferedReader reader=new BufferedReader(new InputStreamReader(p.getInputStream()));
        String line=reader.readLine();
        while(line!=null)
        {
            System.out.println(line);
            line=reader.readLine();
        }


    System.out.println("Done");
}


}

It's return null value. plz help me

And your problem is? What is the forward slash in the "find" command? You are specifying the BEL directory with the find command. The slash is extraneous and may cause a parsing error, unless you have multiple directories at the same level that start with BEL.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.