Problem redirecting output of find to a file

Viewed 33335

I am trying to put the result of a find command to a text file on a unix bash shell

Using:

find ~/* -name "*.txt" -print > list_of_txt_files.list

However the list_of_txt_files.list stays empty and I have to kill the find to have it return the command prompt. I do have many txt files in my home directory

Alternatively How do I save the result of a find command to a text file from the commandline. I thought that this should work

3 Answers

Here is what worked for me

find . -name '*.zip' -exec echo {} \\; > zips.out
Related