Quote:
Originally posted by mijohnst
I want to search some directories for specific file and output it to a file as a list. I thought it would be something like this:
find . -name *.tmp -print >> /tmp/list.txt
When I type this it prints a list of the files it finds on the screen, but nothing in the file I'm redirecting to. I've even tried:
find . -name *.tmp | printf "%s/n" >>/tmp/list.txt
I've had no luck. What am I doing wrong? Sorry, I know this is a basic tool...
|
If you are just trying to get the list of files into another file, why are you wasting your time with the find command?
Use list:
ls -l *.tmp >> /tmp/list.txt
I also do something that may not be required with the find command. I use single quotes around the search string: '*.tmp', nonetheless if you just need the list use the list command. It's both simple and quick.
Hope I have not misread your intent.