How to check last changes in filesystem or directory with bash?

Posted by Robert Vila on Ask Ubuntu See other posts from Ask Ubuntu or by Robert Vila
Published on 2012-11-10T05:14:00Z Indexed on 2012/11/10 5:15 UTC
Read the original article Hit count: 291

Filed under:
|
|
|

After the system unmounted the root partition I detected that some files are missing in the filesystem.

wifi and the gwibber icons disappeared from the indicator applet

I want to check if there are other files missing using the ls program and the locate program, which woks on indexes of a previous state of the filesystem.

Thus,

locate '/usr/share/icons/*' | xargs ls -d 2>&1 >/dev/null

serves for that purpose, and I can count the nonexistent 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 I use:

locate '/usr/share/icons/*' | 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 -I.

Can anyone please help me with this syntax or giving another idea?

© Ask Ubuntu or respective owner

Related posts about bash

Related posts about filesystem