I need to construct a UNIX pipeline that finds all files under the directory containing the word "english" (using find command)and calculate the size of each and sort them . This is my implementation and I am getting an assertion error, any inputs will be appreciated
find /usr/share/dict -type f -name "english*"| xargs -n 1 du | sort -n
The error message is
E AssertionError: assert 44 == 2
E + where 44 = len(['4\t./.git/branches\r', '4\t./.git/objects/info\r', '4\t./.git/objects/pack\r', '4\t./.git/refs/tags\r', '8\t./.cache/v/cache\r', '8\t./.git/info\r', ...])
Two error:
Files can contain "spaces" - user print0
It's must be files. Use -type f
find /usr/share/dict -type f -name "english*" -print0| xargs -0 du | sort -n