Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

The good old days

Name: Anonymous 2022-05-07 9:16

Early on, during the first year of Unix, an ideal was formed for what a Unix program would be: it would receive a number of filenames as command-line arguments, and it would read them. If no filename was given, it would read standard input. It would write its output to standard output. There may be a small number of other fixed command line arguments. The options did not exist. This made it easy to combine programs: the output of one program could be the input of another.

There were of course variations. The
echo
command read nothing. The
cp
,
mv
and
rm
commands did nothing. However, the "filter" was the ideal.

$ cat *.txt | wc


In the example above, the
cat
program reads all files with names with a .txt suffix, writes them to its standard output, which is then redirected to the
wc
program, which reads its standard input (it doesn't have received no file name) to count the words. In short, the above pipeline counts words in all text files.

It was quite powerful. It was also very easy

Name: The Teacher 2022-05-07 10:29

Show me how you `cut` that output to include only line counts.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List