What is the difference between wc -1 < mydata.dat
and
wc -1 < mydata.dat
?
To output the number of lines in the mydata.dat
file, we use the
wc -1 mydata.dat
command.
By adding <
to create the command wc -1 < mydata.dat
, the program opens and reads from the
mydata.dat
file to process the line count. The program sends the contents of
mydata.dat
to wc
's standard input. This is referred to as
redirecting input.
wc -1 < mydata.dat
The output of wc -1 < mydata.dat
is 48
That of wc -1 < mydata.dat
is
48 config.dat