Advertisement
andmalv

[Solucion] Binary file (standard input) matches

Jul 1st, 2015
317
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.43 KB | None | 0 0
  1. Cuando queremos utilizar grep en un archivo binario, nos da el siguiente error
  2.  
  3.     Binary file (standard input) matches
  4.  
  5. Lo que tendremos que hacer es añadirle la opción '-a', para que lo trate como un archivo de texto.
  6.  
  7. Ejemplo
  8.     sudo cat /var/log/syslog | grep -a 'shutdown'
  9.  
  10. O también con los comandos awk y strings
  11.  
  12.     sudo strings /var/log/syslog | grep 'shutdown'  # strings
  13.    
  14.     sudo awk '/shutdown/' /var/log/syslog       # awk
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement