Find command not executing for copying file


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Find command not executing for copying file
# 1  
Old 04-25-2012
Find command not executing for copying file

Buddies, I am trying to copy the file 'xcopyq' from /home/sandip to /home/sandip/testdir using the below command and getting the error as shown below:-

Code:
sandip@manu:~$ find /home/sandip -type f -name '*xcopyq*' -exec cp{} /home/sandip/testdir/ \:
find: missing argument to `-exec'

Am I correctly writing the code ?

Any inputs will help me a lot.

Last edited by methyl; 04-25-2012 at 08:13 AM.. Reason: please use code tags
# 2  
Old 04-25-2012
You don't use :, but ; at the end of the find statement.

Alse please use code tags for posting code.

Hope that helps

Regards
Peasant.
This User Gave Thanks to Peasant For This Post:
# 3  
Old 04-25-2012
Quote:
Originally Posted by Peasant
You don't use :, but ; at the end of the find statement.

Alse please use code tags for posting code.

Hope that helps

Regards
Peasant.


It finally worked! Thanks a ton buddy.

Last edited by sandip250382; 04-25-2012 at 04:03 AM..
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Solaris

How to find IP of user machine executing a particular UNIX command?

Hello, Our applications are deployed in SunOS 5.10 servers. All the team members use a same username/pwd to login to the box. Very often we face issue were we could see that weblogic server instance are KILLED and we are not able to trace who executed kill command. All team members use PUTTY to... (2 Replies)
Discussion started by: santtarius
2 Replies

2. Shell Programming and Scripting

Print filename/dir name while executing aclput using find command

Running below command , but unable to print the filename , is there way to print filename/dirname using -print option find . -type f -exec aclput -i fileacl.template {} \; (5 Replies)
Discussion started by: lalitpct
5 Replies

3. Shell Programming and Scripting

Error while executing switch case for find and replace specific file. Help Me...

case "$inputs" in sapte) find /pools/home_unix/sapte/work/models/model -name "*.xml" exec rm -i {} \;; ckm1) find /pools/home_unix/ckm1/work/models/model -name "*.xml" exec rm -i {} \;; I am getting error like as below. ./menu1.sh: line 144: syntax error near unexpected token `)'... (4 Replies)
Discussion started by: lathigara
4 Replies

4. Shell Programming and Scripting

sed command for copying the contents of other file replacing it another file on specifc pattern

We have 2 file XML files - FILE1.XML and FILE2.xml - we need copy the contents of FILE1.XML and replace in FILE2.xml pattern "<assignedAttributeList></assignedAttributeList>" FILE1.XML 1. <itemList> 2. <item type="Manufactured"> 3. <resourceCode>431048</resourceCode> 4. ... (0 Replies)
Discussion started by: balrajg
0 Replies

5. UNIX for Dummies Questions & Answers

Problem executing find file command in Linux

When trying to find a list of files with specific text in them using find . -type f -exec grep -l "DataStage Job 4263" {}\; I get error find: missing argument to 'exec' How can I correct this ? I'm on Linux Red Hat. Cheers PS I'm a DataStage programmer not a systems support... (4 Replies)
Discussion started by: jackdaw_at_work
4 Replies

6. Shell Programming and Scripting

Help executing command loaded from file

I need to execute a command that is loaded from a file. Basically, we have several scripts that need to be run at scheduled times. We're going to store those times in the database and update a file with data. In that file we'll have scriptName, inputParameters, runTimes, etc... I chose to use... (4 Replies)
Discussion started by: GoldenEye4ever
4 Replies

7. Shell Programming and Scripting

How can I make the for command check to see if a file is empty before executing?

Here is the command in question for f in $(<uploads); do . I only want this to execute if uploads is not empty. If uploads is empty I want the script to quit, actually before the for command. If its not apparent uploads is a text file. Chris (3 Replies)
Discussion started by: chrchcol
3 Replies

8. UNIX for Dummies Questions & Answers

How to find who is executing a file.

Suppose there is a file which is being executed by someone. Is there a way to return the username of whoever is using that file? (7 Replies)
Discussion started by: Sniper Pixie
7 Replies

9. UNIX for Dummies Questions & Answers

Copying file names returned from a grep command into another directory

When I do the following : grep -l "string" *, I get a list of file names returned. Is there a way to copy the files returned from the list into another directory ?. Thanks. (4 Replies)
Discussion started by: Kartheg
4 Replies

10. Shell Programming and Scripting

find command and copying

Trying to write a find command that will be used for incremental backups. Basically find files newer than date, and copy them (directory structures intact) to the backup drive. When I try the following: find / -newer /home/robf/incremental -type f -exec cp -afP {} /backup/inc1 \; It puts all... (1 Reply)
Discussion started by: robf
1 Replies
Login or Register to Ask a Question