Re: tail for a list of files

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

 



find /foo -name "*dog.dat" -ls -exec tail -f {} \;

-print will list only the filename
-ls will list the long dir entry.
{} is needed to deliver the filename you are working with.
\; is needed to signal the end of the command.

On Sat, Mar 3, 2018 at 12:45 PM, Clifford Snow <clifford@xxxxxxxxxxxxxx> wrote:
> Correction - I shouldn't have copy and pasted. drop the {} \; from the
> script
>
> find /foo -name "*dog.dat" -print0 | xargs -0  tail -n5
>
> On Sat, Mar 3, 2018 at 10:44 AM, Clifford Snow <clifford@xxxxxxxxxxxxxx>
> wrote:
>>
>>
>>
>> On Sat, Mar 3, 2018 at 8:40 AM, bruce <badouglas@xxxxxxxxx> wrote:
>>>
>>>
>>> Thanks.. works .. but I forgot one thing...
>>>
>>> Is there a way to list the "file" prior to the tail or would that
>>> require a bash/shell script.. I could have sworn that I've seen how to
>>> accomplish this a while ago...  arggh!
>>>
>> For that I think you need to use xarg as:
>>
>> find /foo -name "*dog.dat" -print0 | xargs -0  tail -n5 {} \;
>>
>>
>> --
>> @osm_seattle
>> osm_seattle.snowandsnow.us
>> OpenStreetMap: Maps with a human touch
>
>
>
>
> --
> @osm_seattle
> osm_seattle.snowandsnow.us
> OpenStreetMap: Maps with a human touch
>
> _______________________________________________
> users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
> To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx
>
_______________________________________________
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