I think the best solution is to use the find command but unfortunately the -maxdepth option is not available on my system. Is there any other way to limit the find command to just the files in the current directory without using *.*?
The command Greg listed works but it only lists the file name. How do you list the entire path and the file name using the command he gave me (see below)?
ls -l $VAR_DIRECTORY|grep -v ^d|tr -s " "|cut -d" " -f9
Also, can someone explain the command above to me? Thanks!
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/*.* >>...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.