find limit output to file

Simon G. simxy at gmx.net
Thu Feb 13 12:54:33 UTC 2014


2014-02-13 13:13 GMT+01:00 Frank Murphy <frankly3d at gmail.com>:
> If I run:
>  find /usr/lib/systemd /etc/systemd -name '*.service' > service-files
>
> How can I limit output to just foo.service, not full paths.

$find /usr/lib/systemd /etc/systemd -name '*.service' -printf '%f\n' >
service-files


More information about the users mailing list