print all filenames in directory with path to another file

view full story

http://www.unix.com – hi, i have a directory at Code: /path/unix with the following files Code: 1.txt 2.txt 3.txt 4.txt I want to make another file called Code: filenames.txt at a different location called /path/home. So, my output file would be Code: /path/home/filenames.txt with contents Code: /path/unix/1.txt /path/unix/2.txt /path/unix/3.txt /path/unix/4.txt I tried the following code Code: ls -d $PWD/* > /path/home/filenames.txt It is giving me an error saying Code: -bash : /bin/ls: Argument list too long (HowTos)