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

Re: find and coy



On 9/1/13, craig@gtek.biz <craig@gtek.biz> wrote:
> find the recent file and copy only it. I have no problem developing that
> find command,

but evidently not quite ...

> but I want to rename the copy in the process by pre-pending
> the file name with the hostname so I can differentiate between dumps from
> different servers. I don't want bother with having to implement a
> destination directory structure since new systems may come and go. So I am
> trying to see how this works by echoing the find output, and I can see what
> the problem is but I don't know how to get around it. find's {} place holder
> is expanding to ./<filename> and I need just <filename>

man find, and search for "-printf format",
ie type "man find<enter>/\-printf format"

Looks like you want a variation on this option:
  -printf "%f\n"

or perhaps -fprintf option

I'm not familiar with -exec option.

Good luck
Zenaan


Reply to: