RE: ls -R | grep char_string
Krzys writes:
>and "mogrep" (below) knows
>what to do with binary and compressed files. -chris
Unfortunately mogrep as implemented relies on the file
names to determine the file type. A neater way might
be to use the 'file' command to determine the file
type
eg:
csk@syd-de-unix:~$ file *
dl: setgid directory
makefile,v: make commands text
myfile: gzip compressed data, deflated, original filename, last
modified:
Fri Aug 18 11:17:10 2000, os: Unix
mygeekcode: ASCII text
pkglists: setgid directory
swgate: setgid directory
swgate.tar.gz: gzip compressed data, deflated, original filename, last
modified:
Fri Aug 18 11:17:10 2000, os: Unix
test: setgid directory
vncviewer: empty
vncviewer.exe: MS-DOS executable (EXE), OS/2 or MS Windows
Note that it picked up that myfile was a gzip file despite its name.
More information in man command.
- Chris Kenrick
Reply to: