Re: find exec rm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/13/2017 09:26 AM, Jon Ingason wrote:
> Den 2017-07-13 kl. 17:33, skrev bruce:
>> hey guys..
>>
>> i'm missing something. thoughts/comments?
>>
>> trying to do a rm with find/exec.
>>
>>  ssh  crawl_user@1.2.3.4 " rm -f '/cloud_nfs/*hash*.dat' ;  find
>> /cloud_nfs  -name '*austincc*master*book*.dat' -exec rm {} \; rm -f
> Here is the problem--------------------------------------------^
> The ";" is part of the find command. Try "...rm {} \; ; rm -f ..."
> I have not tested this but should works.
> 
>> '/cloud_nfs_fetch/*hash*.dat' ; "
>>
>> i get
>> find: paths must precede expression: rm
>> Usage: find [-H] [-L] [-P] [-Olevel] [-D
>> help|tree|search|stat|rates|opt|exec] [path...] [expression]
>>
>> can't seem to see my error...
>>
>> however, if I remove the last rm -- the find/exec/rm works..

Of course, you COULD use "-delete" in the find command rather than
doing an "-exec rm {} \;":

sh  crawl_user@1.2.3.4 " rm -f '/cloud_nfs/*hash*.dat' ;  find
 /cloud_nfs  -name '*austincc*master*book*.dat' -delete; rm -f
'/cloud_nfs_fetch/*hash*.dat' ; "

Might be a bit cleaner and less confusing.
----------------------------------------------------------------------
- Rick Stevens, Systems Engineer, AllDigital    ricks@xxxxxxxxxxxxxx -
- AIM/Skype: therps2        ICQ: 226437340           Yahoo: origrps2 -
-                                                                    -
-      Do you know how to save five drowning lawyers?  No?  GOOD!    -
----------------------------------------------------------------------
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux