Hi friends! 🤓 I am on a gnulinux and trying to list all files in the active directory and it’s subdirectories. I then want to pipe the output to “cat”. I want to pipe the output from cat into grep.

Please help! 😅

  • Björn Tantau@swg-empire.de
    link
    fedilink
    arrow-up
    13
    ·
    8 months ago

    Note, you almost never have to use cat. Just leaving it out would have been enough to find your file (although find is still better).

    When you want to find a string in a file it’s also enough to use grep string file instead of cat file | grep string. You can even search through multiple files with grep string file1 file2 file* and grep will tell you in which file the string was found.