Only filename from find command

Hi All
When we use find command command in Unix we get the result as
/home/user/folder/filename1
/home/user/folder/filename2
/home/user/folder/filename3

Is it possible that i only get the file name
The expected output when using find command is
filename1
filename2
filename3

I am seeking any switch in find command that display only file name

 
your find command | awk -F/ '{print $NF}'

pipe it to

awk -F"/" '{print $NF}'

or

basename ` find command `

I Can't use the awk command.

---------- Post updated at 04:55 AM ---------- Previous update was at 04:51 AM ----------

When using this
basename ` find command `It gives the blank result

can you post your find command.

 basename `find /home/user/folder -newer /home/user/logs -type f` 

Try

find /home/user/folder -newer /home/user/logs -type f | xargs -L1 basename

what kind of error you are getting ?

try this.

 
find /home/user/folder -newer /home/user/logs -type f | sed 's/\(.*\)\/\(.*\)/\2/'

@parthmittal2007 and regarding post #6.
The basename command only expects one filename and some other optional parameters. See man basename . Your script is giving it the optional parameters and creating a command which will never produce any output.

 
find command | while read a; do basename "$i" ; done

Try giving basename the filenames one-by-one.

find /home/user/folder -newer /home/user/logs -type f |while read filename
do
         basename "${filename}"
done

(similar to itkamaraj's post which I have just read).
@itkamaraj your script generates $a but refers to $i .

Without the use of the external command basename:

find command | while read a; do echo ${a##*/} ; done

You can try using the basename command with find:

find <path> -exec basename {} \;

Hope this helps.

Hi,

You can use this,this might work

find filename | cut -d '\' -f4