MaritimeSource
asked on
'find' linux command - filter out directories
I'm running this command:
find . > tmp.txt
but it also includes the directory names it finds along the way. Is there a way to filter out the directories?
Thanks
find . > tmp.txt
but it also includes the directory names it finds along the way. Is there a way to filter out the directories?
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
try with locate tmp.txt
Autogard's comment is the answer to the question, locate is (horrible) unreliable.
locate is faster than find though
<off-topic>
doesn't matter how fast imagination is, I'll wait for the truth ;-)
</off-topic>
doesn't matter how fast imagination is, I'll wait for the truth ;-)
</off-topic>
=== From the man page for find ===
-type c
File is of type c:
b block (buffered) special
c character (unbuffered) special
d directory
p named pipe (FIFO)
f regular file
l symbolic link (never true if the -L option or the -follow option is in effect, unless the symbolic link is broken).
s socket
D door (Solaris)
==========================
So try "find -type f > tmp.txt" (or something similar).