How do I output files within a folder, within a directory into a text file
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I have a directory which has a folder in it full of files I want to output into a text file, but when I run this it only outputs the name of the folder in directory1 instead of all the files within the folder in the directory.
ls directory1 | sort -d -r >> listoffiles.txt
linux directory ls
add a comment |
up vote
0
down vote
favorite
I have a directory which has a folder in it full of files I want to output into a text file, but when I run this it only outputs the name of the folder in directory1 instead of all the files within the folder in the directory.
ls directory1 | sort -d -r >> listoffiles.txt
linux directory ls
are you looking for a recursive directory listing?
– Jeff Schaller
4 hours ago
It is unclear whether you want the names of all the files or the contents of all the files, and whether you want this recursively for all subdirectories or just your one top-level directory.
– Kusalananda
3 hours ago
Need more input; do you have several directories underdirectory1
? Does the subdirectories name ever change?
– tink
3 hours ago
I believe that the OP is cluelessly asking how to concatenate the contents of all the files in a directory into one new file. Voting to close for lack of a clue. Besides, the OP has deleted their account three hours after creating it, so there’s no clear evidence that they actually want an answer.
– G-Man
1 hour ago
add a comment |
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I have a directory which has a folder in it full of files I want to output into a text file, but when I run this it only outputs the name of the folder in directory1 instead of all the files within the folder in the directory.
ls directory1 | sort -d -r >> listoffiles.txt
linux directory ls
I have a directory which has a folder in it full of files I want to output into a text file, but when I run this it only outputs the name of the folder in directory1 instead of all the files within the folder in the directory.
ls directory1 | sort -d -r >> listoffiles.txt
linux directory ls
linux directory ls
edited 4 hours ago
Jeff Schaller
35.6k952118
35.6k952118
asked 4 hours ago
user320481
are you looking for a recursive directory listing?
– Jeff Schaller
4 hours ago
It is unclear whether you want the names of all the files or the contents of all the files, and whether you want this recursively for all subdirectories or just your one top-level directory.
– Kusalananda
3 hours ago
Need more input; do you have several directories underdirectory1
? Does the subdirectories name ever change?
– tink
3 hours ago
I believe that the OP is cluelessly asking how to concatenate the contents of all the files in a directory into one new file. Voting to close for lack of a clue. Besides, the OP has deleted their account three hours after creating it, so there’s no clear evidence that they actually want an answer.
– G-Man
1 hour ago
add a comment |
are you looking for a recursive directory listing?
– Jeff Schaller
4 hours ago
It is unclear whether you want the names of all the files or the contents of all the files, and whether you want this recursively for all subdirectories or just your one top-level directory.
– Kusalananda
3 hours ago
Need more input; do you have several directories underdirectory1
? Does the subdirectories name ever change?
– tink
3 hours ago
I believe that the OP is cluelessly asking how to concatenate the contents of all the files in a directory into one new file. Voting to close for lack of a clue. Besides, the OP has deleted their account three hours after creating it, so there’s no clear evidence that they actually want an answer.
– G-Man
1 hour ago
are you looking for a recursive directory listing?
– Jeff Schaller
4 hours ago
are you looking for a recursive directory listing?
– Jeff Schaller
4 hours ago
It is unclear whether you want the names of all the files or the contents of all the files, and whether you want this recursively for all subdirectories or just your one top-level directory.
– Kusalananda
3 hours ago
It is unclear whether you want the names of all the files or the contents of all the files, and whether you want this recursively for all subdirectories or just your one top-level directory.
– Kusalananda
3 hours ago
Need more input; do you have several directories under
directory1
? Does the subdirectories name ever change?– tink
3 hours ago
Need more input; do you have several directories under
directory1
? Does the subdirectories name ever change?– tink
3 hours ago
I believe that the OP is cluelessly asking how to concatenate the contents of all the files in a directory into one new file. Voting to close for lack of a clue. Besides, the OP has deleted their account three hours after creating it, so there’s no clear evidence that they actually want an answer.
– G-Man
1 hour ago
I believe that the OP is cluelessly asking how to concatenate the contents of all the files in a directory into one new file. Voting to close for lack of a clue. Besides, the OP has deleted their account three hours after creating it, so there’s no clear evidence that they actually want an answer.
– G-Man
1 hour ago
add a comment |
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
active
oldest
votes
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f481136%2fhow-do-i-output-files-within-a-folder-within-a-directory-into-a-text-file%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
are you looking for a recursive directory listing?
– Jeff Schaller
4 hours ago
It is unclear whether you want the names of all the files or the contents of all the files, and whether you want this recursively for all subdirectories or just your one top-level directory.
– Kusalananda
3 hours ago
Need more input; do you have several directories under
directory1
? Does the subdirectories name ever change?– tink
3 hours ago
I believe that the OP is cluelessly asking how to concatenate the contents of all the files in a directory into one new file. Voting to close for lack of a clue. Besides, the OP has deleted their account three hours after creating it, so there’s no clear evidence that they actually want an answer.
– G-Man
1 hour ago