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! 😅

  • surewhynotlem@lemmy.world
    link
    fedilink
    arrow-up
    3
    ·
    10 months ago

    It’s valuable to learn how to do an inline loop

    ls | while read A; do cat $A | grep print; done

    This will read each line of ls into variable A, then it’ll get and grep each one.