Unix/Linux Go Back    


UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !!

Search files for a string in the remote machine

UNIX for Dummies Questions & Answers


Closed Linux or Unix Question    
 
Thread Tools Search this Thread Display Modes
    #1  
Old Unix and Linux 06-14-2005
a_rivu a_rivu is offline
Registered User
 
Join Date: Jun 2005
Last Activity: 23 June 2005, 12:03 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Search files for a string in the remote machine

Hi all,
I want to search the files in a remote machine for a particular string. The SSH command I wrote is giving an error even when the syntax is correct.
ssh user@hostmachine find . -name "*.txt" -exec grep "ARIVU" '{}' \;
The error it gives is find: missing argument to `-exec'

When the following command is executed on a local machine, it is working fine
find . -name "*.txt" -exec grep "ARIVU" '{}' \;

Please let me know where I'm wrong....
Sponsored Links
    #2  
Old Unix and Linux 06-14-2005
DogDay's Unix or Linux Image
DogDay DogDay is offline
Registered User
 
Join Date: Jun 2005
Last Activity: 17 February 2015, 3:39 PM EST
Location: /dev/null
Posts: 83
Thanks: 0
Thanked 1 Time in 1 Post
Quote:
Originally Posted by a_rivu
Hi all,
I want to search the files in a remote machine for a particular string. The SSH command I wrote is giving an error even when the syntax is correct.
ssh user@hostmachine find . -name "*.txt" -exec grep "ARIVU" '{}' \;
The error it gives is find: missing argument to `-exec'

When the following command is executed on a local machine, it is working fine
find . -name "*.txt" -exec grep "ARIVU" '{}' \;

Please let me know where I'm wrong....
Try quoting the command:

ssh user@hostname "find . -name "*.txt" -exec grep "ARIVU" '{}' \;"
Sponsored Links
    #3  
Old Unix and Linux 06-14-2005
a_rivu a_rivu is offline
Registered User
 
Join Date: Jun 2005
Last Activity: 23 June 2005, 12:03 PM EDT
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Thanx boss..... it works....
Sponsored Links
Closed Linux or Unix Question

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Unix or Linux Image More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Help with search string between two files greet_sed Shell Programming and Scripting 5 03-06-2012 03:25 AM
script to delete multiple files in remote machine vkalya Shell Programming and Scripting 1 03-19-2011 07:30 PM
To find the LATEST file from a dir on REMOTE machine and SCP to local machine? me_ub Red Hat 3 07-08-2009 12:57 AM
change files permission on Remote machine almeisan1 Shell Programming and Scripting 1 10-05-2006 12:03 PM
Searching for files in Remote Machine matrixmadhan UNIX for Dummies Questions & Answers 0 06-21-2005 05:02 AM



All times are GMT -4. The time now is 02:06 PM.