Count the number of files in a folder with wc
$ ls | wc -l
will display the number of files in the current directory (folder).
$ ls *.md | wc -l
will display the number of Markdown files in the current directory.
In these two examples, we use ls
to list the content of the directory and then pipe (i.e. |
) the output of ls
to the command wc
which will display number of lines as we invoke the option -l
, short for --lines
.
In the second example we tell ls
to only list Markdown files using a wildcard (i.e. *
) and the extension of Markdown files (i.e. .md
).
To learn about wc
run $ man wc
.
wc
was first released in 19711. It is now part of the coreutils package which is copyleft-licensed and is maintained by Jim Meyering2
✍✍✍✍✍✍✍✍✍✍✍✍✍✍
I do self-funded research and I'm writing a book.
> What's the book about?
About technologies and agency.
Meaning, technologies can foster agency. No doubt. But I am also asking:
Can usage of technologies give us a sense of empowerment while in fact undermining our abilities?
I posted a summary of the prologue on the homepage: https://yctct.com/
✍✍✍✍✍✍✍✍✍✍✍✍✍✍
personal computing command-line interface (cli) gnu linux trisquel shell literacy wc grep wiki office applications