I run "ls -lX" over files umbrella31_*.xvg. I run a command that searches the number on the fifth column of the ls command output, that is larger let's say than 20000. It looks like this:
ls -lX umbrella31_*log | awk '{if($5 >=20000) {print}}' | wc -l
and outputs a number (the number of lines for which the number in column 5 is > 20000).
When I include the above command in a script:
#!/bin/bash -x
ls -lX umbrella31_*log | awk '{if($5 >=20000) {print}}' | wc -l
and run it, I get in the screen the result of "ls" printed as well (which I don't want). How can I get my script behave like my on-screen command, and print only the desired number of lines?
ls -1
? – solsTiCe Oct 11 '19 at 10:45-x
frombash
. – pLumo Oct 11 '19 at 11:29