• expr@programming.dev
    link
    fedilink
    arrow-up
    19
    ·
    edit-2
    3 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.