You can use cat command to display multiple file contents at once. You can use regular expressions for file names.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 |
## Create some files with content echo -e "hello\nworld" > myfile1.txt echo -e "welcome\ncloudaffaire" > myfile2.txt echo "this is a shell script" > myfile3.sh ## display contents of both the file at once cat myfile1.txt myfile2.txt ## returns ## hello ## world ## welcome ## cloudaffaire ## display contents of all files in current directory cat * ## returns ## hello ## world ## welcome ## cloudaffaire ## this is a shell script ## display contents of all files with .txt extention in current dir cat *.txt ## returns ## hello ## world ## welcome ## cloudaffaire |