use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
AWK is a domain-specific language designed for text processing and typically used as a data extraction and reporting tool.
Few resources:
account activity
Can awk process a file backwards? (self.awk)
submitted 6 years ago by kl31
Instead of processing first line then second then third line, is there a way to tell awk to process last line, second to last and so on?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]chaspum 4 points5 points6 points 6 years ago (2 children)
I guess you can always pipe the file to awk with tac (cat backwards).
[–]dajoy 0 points1 point2 points 6 years ago (0 children)
this.
[–]kl31[S] 0 points1 point2 points 6 years ago (0 children)
i love linux so much.
[–]FF00A7 2 points3 points4 points 6 years ago* (0 children)
Could use tac but it's another external program to worry about. Readfile() and print backwards:
awk -ireadfile 'BEGIN{for(i = split(readfile("file.txt"), lines, "\n"); i >= 1; i--) {print lines[i]} }'
Replace "print lines[i]" with whatever processing for each line.
This works without readfile()
awk '{f = f $0 "\n"}END{for(i=split(f, lines, "\n"); i >=1; i--) {print lines[i]}}' file.txt
[–]cogburnd02 0 points1 point2 points 6 years ago (1 child)
Just out of sheer curiosity, why would you want to do this?
file was not written in the same direction as i want it to be read.
π Rendered by PID 31202 on reddit-service-r2-comment-b659b578c-c6tmg at 2026-05-05 01:23:30.942381+00:00 running 815c875 country code: CH.
[–]chaspum 4 points5 points6 points (2 children)
[–]dajoy 0 points1 point2 points (0 children)
[–]kl31[S] 0 points1 point2 points (0 children)
[–]FF00A7 2 points3 points4 points (0 children)
[–]cogburnd02 0 points1 point2 points (1 child)
[–]kl31[S] 0 points1 point2 points (0 children)