find: paths must precede expression: ls HELP!

view story

http://www.linuxquestions.org – I am trying to create text document which lists every file on the server. It is supposed to look in every sub-directory under <dir1> and <dir2> and do an 'ls -lh' and then send the output to a .txt file. However I am receiving the dreaded "find: paths must precede expression: ls" error. Here is my code: find /<dir1> -type f ls -lh >> snapshot.txt find /<dir2> -type f ls -lh >> snapshot.txt Any help or suggestions would be appreciated. (HowTos)