Hi have the following command:
lsscsi | grep HITACHI | awk '{print $6}'
I want that the output will be the number of lines of the original output. For example, if the original output is:
/dev/sda
/dev/sdb
/dev/sdc
The final output will be 3.
lsscsi | grep HITACHI | awk '{print $6}' | wc -lgrep foo | awk '{print $1}'. It should beawk '/foo/{print $1}'. If you useawk,grepis not required meaning unnecessary overhead.