How can I chop out the text, returned by find, after the last "/" ?
$ find home/a/misc/ -type f
home/a/misc/6
home/a/misc/5
home/a/misc/2
I can do it by piping cut -d"/" f4
to the find command but problem is that the folder misc
folder is not always there in folder a. It can be in like /home/a/b/c/d/e/. In that case it will return the element in folder c
Edit: 6, 5 and 2 are files, not directories.
Solved
using -printf %f with the find command did the magic. Thanks to all of you