When trying to manipulate the path to backup log file using grep under Linux the file is recognized as a Binary in error.
Linux, Unix, grep will not operate with the output CSV file. Because the NULL character it will consider that is a binary file:
root@ubuntusql01 # grep 'dir' backup.log.csv Binary file backup.log.csv matches
Workaround consist in pre-append a pipe where the NULL characters are filtered out from the file. The command could similar to:
cat | tr -d '\000' | grep
For example:
root@ubuntusql01 # cat backup.log.csv | tr -d '\000' | grep 'dir' o,/,dir,224,15:09 07 Apr 2020,r-xr-xr-x o,/var,dir,267,16:43 06 Apr 2020,rwxr-xr-x o,/var/log,dir,4096,03:34 01 Feb 2021,rwxr-xr-x o,/var/log/tuned,dir,23,16:43 06 Apr 2020,rwxr-xr-x o,/var/log/audit,dir,42,22:01 11 Dec 2020,rwx------ o,/var/log/anaconda,dir,232,16:43 06 Apr 2020,rwxr-xr-x o,/var/log/rhsm,dir,6,16:43 06 Apr 2020,rwxr-xr-x o,/var/log/vmware,dir,28,16:36 17 Sep 2020,rwxrwxrwx
© 2025 Quest Software Inc. ALL RIGHTS RESERVED. Terms of Use Privacy Cookie Preference Center