|
|
|
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
deleting files
hi,
i need your help again.. i have a directory named as 'projects' under root directory. now, i want to remove *.o (all files with extension.o) in the "projects" directory and in its subdirectories.. for example /projects/hw1/myhw.o /projects/hw2/exercise/56.o ... don't want to remove them one by one.. which command line should i write to remove *.o when working on the root directory.. |
|
#2
|
|||
|
|||
|
First if you really mean this as Unix help you need to learn to lean your slashes to the right, not left - this isn't Windows.
Next, you'll want to do a "man find" for all possible options but the way I do it would be: Code:
find . -name '*.o' -exec rm -f {} \;
though there are other ways.
__________________
Need Java help? Want to help people who do? Sit down with a cup of Java at the hotjoe forums. |
|
#3
|
|||
|
|||
|
Quote:
thanks for your help.. sorry about the slashes.. i have corrected them.. |
|
#4
|
|||
|
|||
|
Or you could do rm -R *.o
Be warned thoug, the -R option is dangerous if misused. If you do rm -Rf *.* by mistake, you delete everything! |
![]() |
| Viewing: Dev Shed Forums > Operating Systems > UNIX Help > deleting files |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|