Problem redirecting output of find to a file

find, pipe, unix

Solution

The first thing I would do is use single quotes (some shells will expand the wildcards, though I don't think `bash` does, at least by default), and the first argument to `find` is a directory, not a list of files:

find ~ -name '*.txt' -print > list_of_txt_files.list

Beyond that, it may just be taking a long time, though I can't imagine anyone having that many text files (you say you have a lot but it would have to be pretty massive to slow down `find`). Try it first without the redirection and see what it outputs:

find ~ -name '*.txt' -print

Problem

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

Original source