Sunday, July 18, 2010

Finding Full Size of a Directory in Human readable format - UNIX/LINUX

Command:   du -sh directory
here, -s, --summarize => display only the total of the specified directory

        -h, human readable format =>print size of a directory in human readable format e.g., 100K or 2000M or 4.9 G

Monday, July 12, 2010

Running a background process - Using the nohup command in UNIX

Command:  
            nohup command &


For example:


If you want to run a java program as a background process you can do the following:

nohup java -cp ./wikify/bin:./wikify/mysql-connector-java-3.1.13-bin.jar:./wikify/trove.jar:./wikify/weka.jar:/usr/share/tomcat6/lib/servlet-api.jar:./wikify/src/org/wikipedia/miner/service/ org.wikipedia.miner.service.WikipediaMiner &


You r program will be running in the background even if you logout from your terminal. Use Kill command to terminate the nohup command