I'd need to filter through a list files (output of top command) for some info:
- Firstly I need to list files with a find
- Then, I need to grep for lines with a pattern
- Finally, I need to pickup one column I'm interested into.
Seems I'm unable to bind the find with both grep and awk:
My first attempt:
find . -name "high-cpu.out" -exec grep "jboss" | awk '{ print $5 }' {} \;
find: missing argument to `-exec'
awk: fatal: cannot open file `{}' for reading (No such file or directory)
Second attempt:
find . -name "high-cpu.out" -exec grep "jboss" {} \ | awk '{ print $5 }';
find: missing argument to `-exec'
Any help? Thanks