Helpful Information
Home
Categories
Contact us
Category: UNIX Help
output a dir's filenames to a txt file
how can i make a one-name-per-line text file from the filenames of a directory? thanks for any help
Luke
PS I know it uses sed or something, but my attempts are not working!
probably no help and you know it already
make file /my/dir/whatever.txt
#cd mydir for list
#script /my/dir/whatever.txt
#ls
lists
then format
newbie way but all i can say
ls -1 > myfile.txt
may be irix specific - check your man page:
man ls
to get a one-name-per-line text file from the filenames of a directory, you can do this :
ls /path/to/dir/ > /path/to/dir/filenames.txt
That should do it.
-Eric
privacy (GDPR)