How to iteratively copy *.jar files


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers How to iteratively copy *.jar files
# 1  
Old 09-24-2008
How to iteratively copy *.jar files

Hello,

I want to copy all *.jar files from a parent tree structure, traversing all sub directories, into the traget dir. What shud be the command for that.

I tried below command from the source parent dir

cp -r *.jar pathtotargetdir

but get the error '*.jar : No such file or directory'.

If I run the command 'find -name *.jar' from the same source parent dir as above, I can see lots of jar files but not able to copy them.

Can anyone tell me the command.
# 2  
Old 09-24-2008
Code:
find . -name '*.jar' | xargs -i cp -p '{}' /path/to/target_dir

or

Code:
 find . -name '*.jar' -exec cp -p '{}' /path/to/target_dir ';'

man find
man xargs.
 
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

View all jar files contents in one go ?

I can view a jar file contents using the below command: $ jar -tvf ./checker-compat-qual-2.0.0.jar 0 Mon May 02 18:28:46 IST 2016 META-INF/ 184 Mon May 02 18:28:44 IST 2016 META-INF/MANIFEST.MF 0 Mon May 02 17:20:16 IST 2016 afu/ 0 Mon May 02 17:20:16 IST 2016 afu/org/ ... (5 Replies)
Discussion started by: mohtashims
5 Replies

2. Shell Programming and Scripting

How to get CRC check sum of files in java EAR file without extracting .jar/.war files to disk.?

unzip -v gives CRC info of each file in a zip(in my case .EAR) file. # unzip -v my-application.ear Archive: my-application.ear Length Method Size Cmpr Date Time CRC-32 Name -------- ------ ------- ---- ---------- ----- -------- ---- 197981 Defl:N 183708 7%... (1 Reply)
Discussion started by: kchinnam
1 Replies

3. Solaris

Differences between jar files

I want to find the difference between two jar files sitting on a sun box. How do I do this? (3 Replies)
Discussion started by: runnerpaul
3 Replies

4. Programming

JAVA - External JAR files in UNIX

Hi, I have to run my JAVA programs in UNIX server. The java program uses some external jar files for compiling. I have set the classpath to the folder where all the jar files are present using EXPORT classpath command. But when i compile, it shows errors.. saying that the classes relating... (8 Replies)
Discussion started by: satish2712
8 Replies

5. UNIX for Dummies Questions & Answers

Crontab not recognizing the jar files

Hi All, I am using crontab which execute a shell script. In the shell script, I am executing a java program. This Java program requires the jar files. The cron job file ' cronfile.txt ' contents: MAILTO="raju_utla@dcis.uohyd.ernet.in" 0-59 * * * *... (4 Replies)
Discussion started by: rajuutla
4 Replies

6. Linux

Crontab not recognizing the jar files

Hi All, I am using crontab which execute a shell script. In the shell script, I am executing a java program. This Java program requires the jar files. The cron job file ' cronfile.txt ' contents: MAILTO="raju_utla@dcis.uohyd.ernet.in" 0-59 * * * *... (3 Replies)
Discussion started by: rajuutla
3 Replies

7. UNIX for Advanced & Expert Users

Crontab not recognizing the jar files

Hi All, I am using crontab which execute a shell script. In the shell script, I am executing a java program. This Java program requires the jar files. The cron job file ' cronfile.txt ' contents: MAILTO="raju_utla@dcis.uohyd.ernet.in" 0-59 * * * *... (0 Replies)
Discussion started by: rajuutla
0 Replies

8. UNIX for Advanced & Expert Users

Question regarding the .tar and .jar files

1) What is the comamnd in need to use to find the diff between .tar files. 2) when i unzip the tar file i get .jar files.. the question i have here is i need to find only the modified file list from the .jar file does any one have done, please do share .... Thanks (0 Replies)
Discussion started by: gkrishnag
0 Replies

9. UNIX for Dummies Questions & Answers

How to find a text in jar and zip files.??

Hi, I have classes dir, in that I have jar and zip files, I need to find "Param.class" is in which zip or jar file? (1 Reply)
Discussion started by: redlotus72
1 Replies
Login or Register to Ask a Question