Skip to content

Comment on Explorations in Unix

Comments

head -3 data* | cat has the same result as head -3 data*

Pipe sends stdout to stdin of the next process. cat sends stdin back to stdout. Piping to cat is rarely eventful (unless you use a flag like cat -n).

Some tools adjust their output based on it going to a terminal or not. Try 'ls' versus 'ls | cat'.

Indeed. I often use ps | cat to get the full command line for processes (that's otherwise truncated). All hail Java command lines.

Try 'ps auxw' - the w enables wide output.

And for really wide commands (like java) you can add another w to get the whole thing: ps auxww

AboutSource Built by g1lg1l

Hackerly is an independent reader for Hacker News, built on the public HN API. Not affiliated with Y Combinator.