Answer the question
In order to leave comments, you need to log in
How to get folder name + file text name + what is written inside?
home/folder1/folder2
home/folder1/file1.txt
home/folder1/folder2/file2.txt
output:
folder1:file1.txt : [what is written inside the text file]
folder2:file2.txt : [what is written inside the text file ]
My code
#!/bin/bash
ff=`find ./* -name "*.txt"`
#fd=`find ./ -type d | grep -o '[^/]*$'`
for i in $ff
do
echo "${i} : $(cat ${i})"
done
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question