After the system unmounted the root partition, I detected that some files are missing in the filesystem.
I am trying to check if other files are missing using the ls program and the locate program, which woks with indexes of a previous state of the filesystem.
locate /usr/share/icons/* | xargs ls -d 2>&1 >/dev/null
serves for that purpose because ls displays an error message for each non-existent file that locate locates; and I can count the missing files like this:
locate /usr/share/icons/* | xargs ls -d 2>&1 >/dev/null | wc -l
except for the case where filenames have blank spaces in them; and, not very surprisingly, that is the case with Ubuntu (OMG!! It is no longer "forbidden" like in good old times).
If, for example, I use:
locate /usr/share/* | xargs -Iñ ls -d 'ñ' 2>&1 >/dev/null
it is not working because there is some kind of interference in the syntax between the redirections of the standard outputs and the use of the parameter
Can anyone please help me with this syntax or giving another idea?
I have eliminated the problem with the blank spaces, but it is not very elegant, like this:
locate /usr/share/* | sed -e 's/^/"/' -e 's/$/"/' | xargs ls -d 2>&1 >/dev/null|
But I'm sure there must be many better solutions which I am eager to read.