Unix How to combine find and cp


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unix How to combine find and cp
# 8  
Old 02-09-2011
I did ,and then ask again Smilie
Code:
find ./ -name "*.csh" -size 10 | xargs cp ./
find ./ -name "*.csh" -size 1 -exec cp ./tova.bac {} \

Thanks
# 9  
Old 02-09-2011
Quote:
Originally Posted by lio123
I did ,and then ask again Smilie
Code:
find ./ -name "*.csh" -size 1 -exec cp ./tova.bac {} \

Thanks
tova.bac is the directory name? And it's a subdirectory of the directory you are currently in? If not that won't work. You need a semicolon ; after that last back slash. \;
This User Gave Thanks to DC Slick For This Post:
# 10  
Old 02-09-2011
I tried this to but didnt work
nova is directorySmilie
Code:
 
find ./ -name "*.csh" -size 1 | xargs cp ./nova

# 11  
Old 02-09-2011
Is nova a subdirectory of the directory you're currently in? The period means "in the directory I'm currently in". So "./nova" means nova is a subdirectory of the directory your shell prompt is currently in. You can find your current directory by typing 'pwd' at the prompt. Might want to specify the full path of the destination directory...
This User Gave Thanks to DC Slick For This Post:
# 12  
Old 02-09-2011
I am trying this nova is subdirectory to the directory I am in
it prints
cp: Insufficient arguments (1)
Code:
 
find ./ -name "*.csh" -size 1 -exec cp ./nova {}\;

# 13  
Old 02-09-2011
Code:
find . -type f -name "*.csh" | xargs cp ./nova


Does this work for you?
# 14  
Old 02-09-2011
Another question ,how can I add to all files in sertain directory extention to the name file1,file2
file1.exe,file2.exe
I tried this but it doesn work
Code:
 
sed s\"  "\.exe\ directory

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to find DISTINCT rows and combine in one row?

Hi , i need to display only one of duplicated values and merged them in one record only when tag started with 3100.2.128.8 3100.2.97.1=192.168.0.12 3100.2.128.8=418/66/03e9/0044801 3100.2.128.8=418/66/03ea/0044601 3100.2.128.8=418/66/03e9/0044801 3100.2.128.8=418/66/03ea/0044601... (5 Replies)
Discussion started by: OTNA
5 Replies

2. Shell Programming and Scripting

how to find first files in a directory and combine them as a single file?

i have below list of files in a directory. /root/admin/files/file1.txt /root/admin/files/file2.txt /root/admin/files/file3.txt /root/admin/files/pattern.txt /root/admin/files/server.txt i need combine the above text files in the below sequence, file1.txt, pattern.txt,server.txt =>... (8 Replies)
Discussion started by: vel4ever
8 Replies

3. Shell Programming and Scripting

Find and delete files and folders which are n days older from one unix server to another unix server

Hi All, Let me know how can i find and delete files from one unix server to another unix server which are 'N' days older. Please note that I need to delete files on remote unix server.So, probably i will need to use sftp, but question is how can i identify files and folders which are 'N'... (2 Replies)
Discussion started by: sachinkl
2 Replies

4. UNIX for Dummies Questions & Answers

UNIX to find the unix mail id

Hi all, Need you assistace. is there any command available in UNIX to find the unix mail id ? tried using 'mail' but no use kindly helpe me out. Thanks in advance. manas (2 Replies)
Discussion started by: manas6
2 Replies

5. Shell Programming and Scripting

How to combine different Excel sheets into a single work book using UNIX

Hi All, I have 4 excel files and i want to combine these 4 files into a single workbook .. my constraints is each work sheet should go to a seperate sheet or tab with sheet name .. my final workbook should have 4 tabs(sheets) each for one. Thanks in Advance.. (3 Replies)
Discussion started by: jagadish99
3 Replies

6. UNIX for Dummies Questions & Answers

unix find command

I need help with tweaking the unix find command. currently the find command searches all the directories under $div/users modified in the last 1 day. find $div/users -type d -mtime +1 I need this changed to find only subdirectories and sub-subdirectories modified in the last 1 day under... (1 Reply)
Discussion started by: mnnarendra
1 Replies

7. Shell Programming and Scripting

Little bit weired : Find files in UNIX w/o using find or where command

Yes , I have to find a file in unix without using any find or where commands.Any pointers for the same would be very helpful as i am beginner in shell scritping and need a solution for the same. Thanks in advance. Regards Jatin Jain (10 Replies)
Discussion started by: jatin.jain
10 Replies

8. Shell Programming and Scripting

How to combine "find" command in for each loop (tcsh)

Hello I was wandering if I can combine find command in side for each loop in unix the main propose is to change some thing in files from several types and not all of them is this possible ? (on liner script? ) tnx for the helppers (3 Replies)
Discussion started by: umen
3 Replies

9. AIX

unix updates- Where can I find unix updates online for IBM servers?

I have a Unix based server running Sagitta and the server is giving me an error of 4b10004 and my research tells me this is an EPROM issue, which means the processor needs to be flashed or repaired. Once up and running where can I go to get updates for Unix? (1 Reply)
Discussion started by: crainer
1 Replies

10. Shell Programming and Scripting

how to find a file in UNIX without find command?

given a start directory,a filename,how to find it? (3 Replies)
Discussion started by: bluo
3 Replies
Login or Register to Ask a Question