I am trying to list just the files in a directory (not the subdirectories or files under the subdirectories) into a temporary file. I have defined the variable VAR_DIRECTORY as the directory I would like the files listed from.
When I use the following command:
ls $VAR_DIRECTORY/*.* >> temp.txt
some directories contain too many files and I receive an error "The parameter list is too long" I don't want to cd to the directory because I want the directory and file name to both be written to temp.txt. So it would look like $VAR_DIRECTORY/filename.
Is there another command I should use? Does ls have any options that would fix this problem?
When I use the following command:
ls $VAR_DIRECTORY/*.* >> temp.txt
some directories contain too many files and I receive an error "The parameter list is too long" I don't want to cd to the directory because I want the directory and file name to both be written to temp.txt. So it would look like $VAR_DIRECTORY/filename.
Is there another command I should use? Does ls have any options that would fix this problem?