mirror of https://github.com/01-edu/public.git
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
29 lines
738 B
29 lines
738 B
2 years ago
|
## Count files
|
||
|
|
||
|
### Instructions
|
||
|
|
||
2 years ago
|
Create a file `count-files.sh`, which will print the number **(and only the number)** of regular files and folders contained in the current directory and its sub-folders (the current directory must be included in the count).
|
||
2 years ago
|
|
||
|
### Usage
|
||
|
|
||
|
```console
|
||
|
$ ./count-files.sh | cat -e
|
||
|
12$
|
||
|
$
|
||
|
```
|
||
|
|
||
2 years ago
|
### Hints
|
||
2 years ago
|
|
||
|
Here are some Commands that can help you:
|
||
|
|
||
2 years ago
|
- `find`. Find files or directories under the given directory tree, recursively.
|
||
|
- `wc`. Count lines, words, and bytes.
|
||
2 years ago
|
|
||
2 years ago
|
> You have to use Man or Google to know more about commands flags, in order to solve this exercise!
|
||
|
> Google and Man will be your friends!
|
||
|
|
||
|
### References
|
||
|
|
||
|
- [Find](https://manned.org/find).
|
||
|
- [wc](https://www.gnu.org/software/coreutils/wc).
|