How in the terminal linux recursively display the contents of files whose name begins with 'c', without using the find command? I tried cat ./c* - but this method does not work.

  • 2
    grep -r and more? - pavel

1 answer 1

 grep -rh '.*' ./c* 

The switch -h allows not to display the file name at the beginning of each line of output. If you remove it, then each line of output will look like:

 file/path/name:output string 

PS By the way, maybe you need it. If you specify:

 grep -rl '<pattern>' ./c* 

This will display a list of the names of all files in the current directory and below, starting with a 'c' in the text of which <pattern>