You can use the
basename utility:
Code:
find / -type f -name 'test.log' -exec basename {} \; 2>/dev/null
If you're not executing the above as root (with
su - or
sudo), you may want to add the
2>/dev/null so you don't see all the errors that look like these
Code:
.
.
.
find: `/proc/31910/task/31910/fd': Permission denied
find: `/proc/31910/task/31910/fdinfo': Permission denied
find: `/proc/31910/task/31912/fd': Permission denied
find: `/proc/31910/task/31912/fdinfo': Permission denied
find: `/proc/31910/task/31914/fd': Permission denied
find: `/proc/31910/task/31914/fdinfo': Permission denied
find: `/proc/31910/fd': Permission denied
find: `/proc/31910/fdinfo': Permission denied
.
.
.
Hope this helps some.