Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Search files for a string in the remote machine Post 74955 by DogDay on Tuesday 14th of June 2005 02:20:11 PM
Old 06-14-2005
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" '{}' \;"
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Searching for files in Remote Machine

hi all, i would like to how to perform remote search on a tandem machine from solaris box. I have the userid and password to log in. But the directory, file structures, naming conventions are different. now how to search for a particular pattern of files say, <user1><date>.log files in... (0 Replies)
Discussion started by: matrixmadhan
0 Replies

2. Shell Programming and Scripting

change files permission on Remote machine

I would like to change permissions recursively on a remote folder. Seems like sftp has a limitation, I am only able to change permission on a individual file.. sftp > chmod 777 /usr/local/apache/docs/test.txt It would be great if someone has more knowledge on how this is doable recursively? (1 Reply)
Discussion started by: almeisan1
1 Replies

3. UNIX for Dummies Questions & Answers

What is the Best way to search files for a string??

I'm looking to seach all the files in a directory and sub-directories looking for a string. When the string is found, I want to display the filename and the entire line of that file that the string was found on. what is the best way to do this ?? I've been playing around with awk, find, and... (15 Replies)
Discussion started by: 35Soinc
15 Replies

4. Red Hat

To find the LATEST file from a dir on REMOTE machine and SCP to local machine?

Hi All, URGENT - Please help me form a scipt for this: I need the LATEST file from a dir on REMOTE machine to be SCP'd to a dir on local machine. (and I need to execute this from local server) I know that the below cmd is used to find the LATEST file from a dir. But this command is not... (3 Replies)
Discussion started by: me_ub
3 Replies

5. Shell Programming and Scripting

script to delete multiple files in remote machine

Requirement Several files in remote machines ought to be deleted via sh. Name of the files to be deleted are know Approach 1) script was written with ftp (requires credential) and delete command. File names were passed as array(iterated via for loop-with ftp+delete commands enclosed within... (1 Reply)
Discussion started by: vkalya
1 Replies

6. Shell Programming and Scripting

Help with search string between two files

Hi, Basically i want to search for a string in file two based on the input file one and if it matches get the nextline and print the value of the field name. cat one abc xyz defcat two <src> <name="path/to/abc" test="value_version"> <new name="Y2" > </src> <src> <name="path/to/xyz"... (5 Replies)
Discussion started by: greet_sed
5 Replies

7. Shell Programming and Scripting

Search several string and convert into a single line for each search string using awk command AIX?.

I need to search the file using strings "Request Type" , " Request Method" , "Response Type" and by using result set find the xml tags and convert into a single line?. below are the scenarios. Cat test Nov 10, 2012 5:17:53 AM INFO: Request Type Line 1.... (5 Replies)
Discussion started by: laknar
5 Replies

8. UNIX for Advanced & Expert Users

FTP While transfering files to local machine to remote machine

Hi Am using unix Ksh Am getting the problem while transferring zero size files through the script . When i transfer zero size files from local machine to remote machine manually i can able to do it . My question its beause of zero size files am not able to transfer through script ? or its... (2 Replies)
Discussion started by: Venkatesh1
2 Replies

9. Red Hat

iptables applied in local machine, can't ssh remote machine after chain changed to DROP

I want to SSH to 192.168.1.15 Server from my machine, my ip was 192.168.1.99 Source Destination was UP, with IP 192.168.1.15. This is LAN Network there are 30 Machine's Connected to the network and working fine, I'm Playing around the local machine's because I need to apply the same rules in... (2 Replies)
Discussion started by: babinlonston
2 Replies

10. Shell Programming and Scripting

Help with fetching the data from remote machine from my jumpbox(local machine)

Team, Presently i am running a script from my local box(i.e jumpbox) to all the remote machines.Basically fetching basic queries like pwd,mkdir,touch etc and i am able to successfully fetch it from my local machine.But when i want to check certain database related queries like the dbstat... (20 Replies)
Discussion started by: whizkidash
20 Replies
DEBRSIGN(1)						      General Commands Manual						       DEBRSIGN(1)

NAME
       debrsign - remotely sign a Debian changes and dsc file pair using SSH

SYNOPSIS
       debrsign [options] [user@]remotehost [changes-file|dsc-file]

DESCRIPTION
       debrsign  takes	either	an  unsigned  .dsc file or an unsigned .changes file and the associated unsigned .dsc file (found by replacing the
       architecture name and .changes by .dsc) if it appears in the .changes file and signs them by copying  them  to  the  remote  machine  using
       ssh(1)  and  remotely  running  debsign(1)  on  that machine.  All options not listed below are passed to the debsign program on the remote
       machine.

       If a .changes or .dsc file is specified, it is signed, otherwise, debian/changelog is parsed to determine the name of the .changes file	to
       look for in the parent directory.

       This  utility  is useful if a developer must build a package on one machine where it is unsafe to sign it; they need then only transfer the
       small .dsc and .changes files to a safe machine and then use the debsign program to sign them before transferring them back.  This  program
       automates this process.

       To  do  it  the	other way round, that is to connect to an unsafe machine to download the .dsc and .changes files, to sign them locally and
       then to transfer them back, see the debsign(1) program, which can do this task.

OPTIONS
       -S     Look for a source-only .changes file instead of a binary-build changes file.

       -adebian-architecture, -tGNU-system-type
	      See dpkg-architecture(1) for a description of these options.  They affect the search for the .changes file.  They  are  provided	to
	      mimic the behaviour of dpkg-buildpackage when determining the name of the .changes file.

       --multi
	      Multiarch  changes  mode:  This  signifies  that	debrsign  should  use  the  most  recent  file	with the name pattern package_ver-
	      sion_*+*.changes as the changes file, allowing for the changes files produced by dpkg-cross.

       --path remote-path
	      Specify a path to the GPG binary on the remote host.

       --help, --version
	      Show help message and version information respectively.

       Other options
	      All other options are passed on to debsign on the remote machine.

CONFIGURATION VARIABLES
       The two configuration files /etc/devscripts.conf and ~/.devscripts are sourced in that order to set configuration variables.  Command  line
       options	can  be  used to override configuration file settings.	Environment variable settings are ignored for this purpose.  The currently
       recognised variables are:

       DEBRSIGN_PGP_PATH
	      Equivalent to passing --path on the command line (see above.)

SEE ALSO
       debsign(1), dpkg-architecture(1) and ssh(1).

AUTHOR
       This program was written by Julian Gilbey <jdg@debian.org> and is copyright under the GPL, version 2 or later.

DEBIAN								 Debian Utilities						       DEBRSIGN(1)
All times are GMT -4. The time now is 01:32 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy