M
M
miska2014-07-27 10:26:26
CentOS
miska, 2014-07-27 10:26:26

Linux - How to output the contents of folders (defined, given in a file) to a text file?

Actually the question is:
1 - There is a text file with some folders whose contents need to be displayed:
/home/user1/
/home/user100/
home/user200/
2 - There is a folder on the server with the contents
/home/user1/
/home/user2/
/home /user3/
......
/home/user10000/
3 - You need to output the contents of the folders from the file in step 1 to a text file in the following format:
/home/user1/file1
/home/user1/file2
/home/user1/ file3 By
means of ls /home/*/* > result.txt
it turns out to display only
/home/user1/
file1
file2
file3
Which is not suitable. Help to make a ready-made solution - preferably simpler.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
I
Ivan Starkov, 2014-07-27
@icelaba

directories are in dirs.txt
then output like this
cat dirs.txt | xargs -n 1 find

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question