Hacker News new | ask | show | jobs
by Anthony-G 497 days ago
I’m no AWK expert but I know just enough to tell when it’s the right tool for a particular job. Most pipelines consisting of `grep`, `sed` and `cut` commands can be replaced with a single AWK command. In this case:

    stat / | awk '/Birth:/ { print $2; }'
For the line containing the `Birth:` regex, print the second field (by default, fields are delimited by spaces). Other lines that don’t match the regex are ignored.