|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Help with find command
I want to find out all the files whose extension is .java or .jsp or .html from a particular directory.
For example, find $HOME -name '*.jsp' command would search for only jsp files. This way I want to find out all the files whose extension is java, jsp or html. Any clues on this would be appreciated. Thanks for your time. |
|
#2
|
|||
|
|||
|
Quote:
Most simple solution: find $HOME -name '*.java' >/tmp/list find $HOME -name '*.jsp' >>/tmp/list find $HOME -name '*.html' >>/tmp/list Now you can for instance: cat /tmp/list | cpio -ovcaB >/dev/your_tape_device Regards ![]() |
|
#3
|
|||
|
|||
|
Quote:
just to add to zlutovsky's You can also use -o (or) like \(-name '*.java' -o -name '*.jsp' -o ...... \) instead of 3 line -a(and) is implied or default |
|
#4
|
|||
|
|||
|
VERY simple and imo NOT the solution :
Quote:
Q: who said, you can write /tmp/list ? suppose /tmp/list is still there owned by an other user NOT in your group and and and the ONLY safe place for tmps is NOT /tmp but $HOME gruntz way is better an alternative to that would be find . ¦ egrep "...¦...¦..." (NOTA: i prefer sed) but for this you should read manuals, do it! a last remarque zlutovsky not only you are running 3 times find, but you also open(and close) 3 times the same fd ![]() the problem is: today our hw is good, do that on a 30years old NCRtower1632, you will undestand what i mean.
__________________
working on Solaris[5-9], preferred languages french and C. |
|
#5
|
|||
|
|||
|
Thanks to all.
|
|
#6
|
||||
|
||||
|
Quote:
Make a unique file - Quote:
|
|
#7
|
|||
|
|||
|
Quote:
|
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > Help with find command |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|