...
Print processes owned by root:
| No Format |
|---|
ps aux|groovy -anea -ne "if(split[0] =~ 'root')println split[10..-1]" |
...
Add the first and the penultimate column of a file:
| No Format |
|---|
groovy -apea -pe "split[0].toInteger()+split[-2].toInteger()" accounts.txt |
...