linux - How to extract name of all files contained in a folder into a .txt file? -
i want extract name of files contained in folder .txt file ex: when type ls command in terminal shows list files , folder names. can store these names in .txt file.
you can redirect output of ls
command file >
so:
ls > files.txt
note overwrite previous contents of files.txt
. append, use >>
instead so:
ls >> files.txt
Comments
Post a Comment