Hi! I am trying to search/grep for empty files on MacOS, zsh:
For those for cannot see the image, its a screenshot with the following text:
Task 14, Some of the files in our project which end with the suffix, .txt , have no content in them. List the files, across all the continent directories, that end with .txt that have no content and save the listing in a file, empty_files.txt , in the todo/ directory.
When a file has no content, there should be a word count of 0! You can use a combination of the
grep commands via a pipe
| and redirect the final output with the
> symbol. Make use of the wildcard
* to select all the .txt files from all the directories.
So far I have experimented with several commands and I’m trying to start by breaking down this prompt. Right now I am entering:
$ grep -Rl " " ./*/* # resulting in: ./africa/afrikaans.txt ./asia/arabic.txt ./asia/malay.txt ./europe/english.txt ./europe/portuguese.txt ./northamerica/english.txt ./southamerica/portuguese.txt
I don’t think I understand the task correctly.
Can anyone help me break this task down a little more or help me out with a hint?