linux - Is there a easy way to display all contents of all files with a recursive mode in one directory? -


provided have following directory structure:

. ├── 2.txt ├── 3.txt └──     └── 1.txt 

now want display contents of files in directory, considered recursion. possible format displaying bellow:

a/1.txt:  ...the content of 1.txt  2.txt:  ...the content of 2.txt  3.txt:  ...the content of 3.txt 

you can use find command -exec option run cat command on files listed, in case, text files,

find  . -name "*.txt" -print -exec cat "{}" \; 

run command top folder containing files 2.txt , 3.txt should display file contents name needed.


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -