After creating a few directories and hidden files and running the following commands
JavaScript
x
ls -al | wc -l
ls -a1 | wc -l
I get a difference in the total returned by the word count program. The
JavaScript
ls -al | wc -l
command returns one more count. Why is this?
Advertisement
Answer
JavaScript
$ ls -al | head -n 1
total 57600
This line is not shown with -1
.