Tuesday, November 5, 2013

Command used in day to day activity

Command to find the used ports in server

netstat -ln | grep '80 ' | grep 'LISTEN'
netstat -atnp|grep LISTEN 

netstat -ln | grep '99 ' | grep 'LISTEN'
 netstat -ln | grep '16'

telnet <machine_IP> <port>

Command  for copying files to server

 scp -pr RMVServices-0.0.2-SNAPSHOT.war shib@

Command for multiple search 

tail -f /tmp/Liferay-JBoss.out |grep 'PAGENAME\|tabName'

grep 'PAGENAME\|tabName'  for multiple search

Command to set line no in VI Editor

:set nu   for line no

:/ERROR   for ERROR search in VI

grep -r devapp214 ./|grep tst2

Command to shutdown jboss 

./shutdown.sh -s

./shutdown.sh -s

Command to search files

find ./ -name jboss-admin.sh

Command to see difference in  files

sdiff  ./pdf.css  /opt/dadm/liferay-portal-6.0-ee-sp2/jboss-.1.0/server/default/deploy/PPortlet.war/css/pdf.css

 Schedule a Background Cron Job For Every 10 Minutes.

Use the following, if you want to check the disk space every 10 minutes.
*/10 * * * * /home/ramesh/check-disk-space