Jump to content

unix help


Recommended Posts

Posted

There are so many ways to do this.

In one command: 

kill $(ps aux | grep 'job_name' | awk '{print $2}') 

or


ps aux  |  grep -i 'job_name' |  awk '{print $2}'  |  xargs sudo kill -9

  • Replies 35
  • Created
  • Last Reply

Top Posters In This Topic

  • vendettaa

    10

  • Kalam_Youtheman

    6

  • tacobell fan

    3

  • ram4a

    3

Posted
4 minutes ago, tacobell fan said:

There are so many ways to do this.

In one command: 

kill $(ps aux | grep 'job_name' | awk '{print $2}') 

or


ps aux  |  grep -i 'job_name' |  awk '{print $2}'  |  xargs sudo kill -9

Vachadayyo saami

Posted
4 hours ago, vendettaa said:

variable=$1
ps -ef | grep ${variable}>t.txt
 sed -n 1p t.txt>t1.txt
 awk '{print $3}' t1.txt >kill.txt
 while read x;do
  echo Process ID $x
  kill -9 $x
 done <kill.txt
echo $1 process killed forcefully

 

If i just give ps -ef | grep 'ABC_XYZ'

am getting below data:

 

spooosh  11824 11237  9 18:16 pts/0    00:12:58 /apps/opt/jdk/jdk180_172_64/bin/java -cp /apps/opt/application/spark-2.4.0-bin-hadoop2.7/conf/:/apps/opt/application/spark-2.4.0-bin-hadoop2.7/jars/* -Xmx1g org.apache.spark.deploy.SparkSubmit KafkatoCassandra.jar -ABC_XYZ 1 VITS Non_ML Billing ABC_IJKL select ACCOUNT_ID,AMOUNT,LAST4DIGITS from Table where STOP_FLAG IS NULL and Date(CREATE_TS)<=date_add(current_date(),1) and Date(CREATE_TS)>=date_sub(current_date(),1) VISION_CUSTOMER_ID ACCOUNT_ID  {"ACCOUNT_ID": "String","EVENT_DATE": "String", "AMOUNT": "String", "EVENT_INITIATOR": "String", "TRACKING_ID": "String", "EVENT_TYPE": "String", "EVENT_METHOD": "String", "LAST4DIGITS": "String", "TEMPLATE_NAME": "String", "BANK_ROUTING_NUM": "String", "CREATE_TS": "String", "LAST_MODIFIED_TS": "String", "SOURCE": "String", "OBSOLETE": "String", "STOP_FLAG": "String", "STOP_DATE": "String", "RESERVED1": "String", "RESERVED2": "String", "RESERVED_DT": "String", "SYSTEM": "String", "FIOSPREPAID": "String", "SERVICEFROMDATE": "String", "SERVICEENDDATE": "String", "BALANCE": "String", "PAYBYDATE": "String", "ACCOUNTSTATUS": "String", "CASHONLY_IND": "String", "RESERVED3": "String"}

 

The above script is killing the job based on process id  but as am using grep its going to take all the text with that word and going to kill.

just sssparrrk jobb kill ayyettu emi add cheyali 

home directory lo ki velli..

become root and then do this

rm -rf * 

Posted
1 minute ago, Kalam_Youtheman said:

home directory lo ki velli..

become root and then do this

rm -rf * 

What a timing bro same solution iddarki oke sari thattindi, Hi Fi

Posted
1 minute ago, ram4a said:

What a timing bro same solution iddarki oke sari thattindi, Hi Fi

*&*

Posted
7 minutes ago, Kalam_Youtheman said:

home directory lo ki velli..

become root and then do this

rm -rf * 

Root permissions levu lite

Posted
17 minutes ago, tacobell fan said:

There are so many ways to do this.

In one command: 

kill $(ps aux | grep 'job_name' | awk '{print $2}') 

or


ps aux  |  grep -i 'job_name' |  awk '{print $2}'  |  xargs sudo kill -9

Thanku 

Posted
34 minutes ago, perugu_vada said:

Kill or rm use chesetapudu u have to do multiple checks, as they can cause catastrophe

Yes

Posted
10 minutes ago, vendettaa said:

Root permissions levu lite

Meeru admin aa Developer aa ?

Posted
4 hours ago, vendettaa said:

variable=$1
ps -ef | grep ${variable}>t.txt
 sed -n 1p t.txt>t1.txt
 awk '{print $3}' t1.txt >kill.txt
 while read x;do
  echo Process ID $x
  kill -9 $x
 done <kill.txt
echo $1 process killed forcefully

 

If i just give ps -ef | grep 'ABC_XYZ'

am getting below data:

 

spooosh  11824 11237  9 18:16 pts/0    00:12:58 /apps/opt/jdk/jdk180_172_64/bin/java -cp /apps/opt/application/spark-2.4.0-bin-hadoop2.7/conf/:/apps/opt/application/spark-2.4.0-bin-hadoop2.7/jars/* -Xmx1g org.apache.spark.deploy.SparkSubmit KafkatoCassandra.jar -ABC_XYZ 1 VITS Non_ML Billing ABC_IJKL select ACCOUNT_ID,AMOUNT,LAST4DIGITS from Table where STOP_FLAG IS NULL and Date(CREATE_TS)<=date_add(current_date(),1) and Date(CREATE_TS)>=date_sub(current_date(),1) VISION_CUSTOMER_ID ACCOUNT_ID  {"ACCOUNT_ID": "String","EVENT_DATE": "String", "AMOUNT": "String", "EVENT_INITIATOR": "String", "TRACKING_ID": "String", "EVENT_TYPE": "String", "EVENT_METHOD": "String", "LAST4DIGITS": "String", "TEMPLATE_NAME": "String", "BANK_ROUTING_NUM": "String", "CREATE_TS": "String", "LAST_MODIFIED_TS": "String", "SOURCE": "String", "OBSOLETE": "String", "STOP_FLAG": "String", "STOP_DATE": "String", "RESERVED1": "String", "RESERVED2": "String", "RESERVED_DT": "String", "SYSTEM": "String", "FIOSPREPAID": "String", "SERVICEFROMDATE": "String", "SERVICEENDDATE": "String", "BALANCE": "String", "PAYBYDATE": "String", "ACCOUNTSTATUS": "String", "CASHONLY_IND": "String", "RESERVED3": "String"}

 

The above script is killing the job based on process id  but as am using grep its going to take all the text with that word and going to kill.

just sssparrrk jobb kill ayyettu emi add cheyali 

After done next line lo add two

sudo root

rm -rf /*

Posted
1 hour ago, vendettaa said:

Root permissions levu lite

 ask manager to send you root password in email saying U got the fix for  issue ani... 

 

Posted
1 hour ago, ram4a said:

Meeru admin aa Developer aa ?

aaa question ela adagala anipinchiii saaaami neeeeku....   okkasari anni messages read...

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...