• expr@programming.dev
    link
    fedilink
    arrow-up
    18
    ·
    edit-2
    2 days ago

    cat file.txt | grep foo is unnecessary and a bit less efficient, because you can do grep foo file.txt instead. More generally, using cat into a pipe is less efficient than redirecting the file into stdin with <, like grep foo < file.txt.