Skip to main content

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@100.1.127.11:/home/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 172.23.2.5:7109

./shutdown.sh -s 172.23.2.25:1399

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

Comments

Popular posts from this blog

Basic shell scripting part 1

What is $*? Its mainly used for showing up all params. This show all parameter values passed in shell script What does $# stand for? # will return the number of parameters that are passed as the command-line arguments. What does $? Return? $? will return exit status of command .0 if command gets successfully executed ,non-zero if command failed. What are Different types of shells? sh : the oldest shell  csh : C shell  ksh : Korn Shell  bash : bourne again shell  How do you read arguments in a shell program – $1, $2? Shell script accepts parameters in following format…  $1 would be the first command line argument, $2 the second, and so on  $0 is the name of the script or function If your script has more than 9 params then accept in following way…  ${12} : 12th param  ${18} : 18th param What are the different kinds of loops available in shell script ? for, if, while, case What is the difference...

Linux and Maven Commands

Maven mvn -Dmaven.test.skip=true -e clean install mvn clean install mvn clean install -Dmaven.test.skip=true Linux: telnet mq.dev.sum.org  9012 telnet <machine_IP> <port> Sudo su Su - sudo -u dev2adm  -i ps -ef|grep jboss Find a folder Just find directories and skip file names pass the  -type d  option as follows: find   / - type d -name "apt" - ls locate httpdocs Delete latest 3 files: rm -f $(ls -1t ./ | head -3)   working fine ls -d -1tr /path/to/folder/* | head -n -10 | xargs -d '\n' rm -f rm -f $(ls -1t ./ | tail -n +4) netstat -ln | grep '80 ' | grep 'LISTEN' netstat -atnp|grep LISTEN  netstat -ln | grep '99 ' | grep 'LISTEN'  netstat -ln | grep '16'  scp -pr Services-0.0.2-SNAPSHOT.war sbiswas@172.1.8.141:/home/sbiswas tail -f /tmp/Liferay-JBoss.out |grep 'PAGENAME\|tabName' grep 'PAGENAME\|tabName'  for multiple se...

SED COMMAND TO DELETE LINES IN FILE

Sed Command to Delete Lines : Sed command can be used to delete or remove specific lines which matches a given pattern or in a particular position in a file. Here we will see how to delete lines using sed command with various examples. The following file contains a sample data which is used as input file in all the examples: > cat file linux unix fedora debian ubuntu SED COMMAND TO DELETE LINES - BASED ON POSITION IN FILE In the following examples, the sed command removes the lines in file that are in a particular position in a file. 1.  Delete first line or header line The d option in sed command is used to delete a line. The syntax for deleting a line is: > sed 'Nd' file Here N indicates Nth line in a file. In the following example, the sed command removes the first line in a file. > sed '1d' file unix fedora debian ubuntu 2.  Delete last line or footer line or trailer line The following sed comm...