Q:

Multiple use of grep command

Can anyone tell what this line actually mean?? Here the grep command is used multiple times.
#chkCount=`ps -aef | grep -i "File_Transfer.sh"|grep -v grep| wc -l`

A:

Let's break this down piece by piece.  First of all the command is commented out so it won't run until you remove the starting #
chkCount=`ps -aef | grep -i "File_Transfer.sh"|grep -v grep| wc -l`

The output of the command ps -aef | grep -i "File_Transfer.sh"|grep -v grep| wc -l will be stored in the variable chkCount.
grep -i "File_Transfer.sh" looks for lines containing "File_Transfer.sh" but grep will ignore the case of the string.  That means that grep will match "File_Transfer.sh", "File_TRANSFER.SH", or any other combination.
grep -v grep will match any line that DOESN'T contain the word grep.  -v inverts the match.  The purpose of this is to eliminate the command you issued.  In other words ps will list a process called File_Transer.sh and it will list your command  ps -aef | grep -i "File_Transfer.sh"|grep -v grep| wc -l.  grep -v will ignore ps -aef | grep -i "File_Transfer.sh"|grep -v grep| wc -l and just match any process matching File_Transfer.sh
Lastly, wc -l will count the number of lines fed into wc.  So the result will be the number of processes running that matches "File_Transfer.sh"

