When I am using the command to find all the files in a directory and its sub directories and redirecting the output into a file result.txt, then in result.txt file I am getting all the files including result.txt but I don't want result.txt.
like I am doing
find . -type f > allfiles.txt
in result I am getting as
./test1/test3/file4 ./test1/file3 ./test2/test4/file6 ./test2/file5 ./allfiles.txt
How to avoid that?