Grep files older than 1 day

I thought that this would work for grep'ing files older than 1 day.

ps -o etime,pid,user,args -e|awk '/^[0-9]+-/'|sort -t- -n -k 1,1 |grep qdaemon |grep /usr/bin/ksh

But, it is not grep'ing any of files (i.e. below) older than 1 day.

  d_prod 33757970 61999560   0   Oct 27      -  0:00 /usr/lib/lpd/piobe -d s /var/spool/qdaemon/t__byia 
  d_prod 33823732 64297016   0   Oct 27      -  0:00 /usr/lib/lpd/pio/etc/piohpnpf -x umhn-gw45e-ps1 -p 9100 
  d_prod 33954782        1   0   Oct 22      -  0:00 /usr/lib/lpd/pio/etc/piohpnpf -x iphb-4h16-ps1 -p 9100 
  d_prod 34020298 20388700   0   Oct 27      -  0:00 /usr/lib/lpd/pio/etc/piohpnpf -x umhs-5picu-ps3 -p 9100 
  d_prod 34216790        1   0   Oct 25      -  0:00 /usr/lib/lpd/pio/etc/piohpnpf -x 10.2.4.14 -p 9100 
  d_prod 34282318        1   0   Oct 19      -  0:01 /usr/lib/lpd/pio/etc/piohpnpf -x 10.2.4.14 -p 9100 
  d_prod 35789678        1   0   Oct 18      -  0:01 /usr/lib/lpd/pio/etc/piohpnpf -x 10.1.2.147 -p 9100 
  d_prod 36117352        1   0   Oct 14      -  0:01 /usr/lib/lpd/pio/etc/piohpnpf -x stt-t6s22-ps1 -p 9100 
  d_prod 36445134        1   0   Oct 13      -  0:01 /usr/lib/lpd/pio/etc/piohpnpf -x stt-3n12-ps1 -p 9100 
  d_prod 36576086 55054126   0   Oct 18      -  0:00 /usr/lib/lpd/pio/etc/pioout -A0 -B33431 -C14688 -F\14\15 
  d_prod 36772662 43260322   0   Oct 24      -  0:00 /usr/lib/lpd/pio/etc/pioout -A0 -B34448 -C14688 -F\14\15 
  d_prod 36969394        1   0   Oct 25      -  0:00 /usr/lib/lpd/pio/etc/piohpnpf -x umhs-6d04-ps1 -p 9100 
  d_prod 37166000        1   0   Oct 26      -  0:00 /usr/lib/lpd/pio/etc/piohpnpf -x umhs-7c02-ps1 -p 9100 
  d_prod 37296914        1   0   Oct 25      -  0:00 /usr/lib/lpd/piobe -d s /var/spool/qdaemon/t__gxUa 

Please advise.

see

man find 

find files older than 1 day then grep a string.

Are you looking for files or for processes?

Sorry!! I am looking for PID older than 1 day.
Please advise.

Try this:

ps -o etime,pid,user,args -e | awk '$1 ~ /[0-9]+\-/'

As I can't see "/usr/bin/ksh" in any of the lines matching "qdaemon" I'm not surprised your output is empty. Try without the last grep.

# ps -o etime,pid,user,args -e | awk '$1 ~ /[0-9]+\-/' |grep pio
19-08:53:21 12517408   d_prod /usr/lib/lpd/pio/etc/piohpnpf -x iphb-3h25-ps2 -p 9100 
12-19:37:39 24051782   d_prod /usr/lib/lpd/pio/etc/piohpnpf -x 10.5.3.38 -p 9100 
 7-06:06:23 44630260   d_prod /usr/lib/lpd/pio/etc/piohpnpf -x stt-t6s22-ps1 -p 9100 
14-20:19:45 11665916   d_prod /usr/lib/lpd/pio/etc/piohpnpf -x 10.3.4.18 -p 9100 
 4-06:34:30 16908752   d_prod /usr/lib/lpd/pio/etc/piohpnpf -x umhs-5picu-ps1 -p 9100 
 9-06:08:08 21561844   d_prod /usr/lib/lpd/piobe -d s /var/spool/qdaemon/t--g3aa 
 2-06:39:09 40436142   d_prod /usr/lib/lpd/pio/etc/pioout -A0 -B34448 -C14688 -F\14\15 
14-08:43:36 42598762   d_prod /usr/lib/lpd/pio/etc/piohpnpf -x 10.5.3.38 -p 9100 
 6-06:31:22 44499334   d_prod /usr/lib/lpd/pio/etc/piohpnpf -x umhn-10w52a-ps1 -p 9100 
10-06:32:53 55509354   d_prod /usr/lib/lpd/pio/etc/piohpnpf -x umhn-10w52a-ps1 -p 9100 
 5-15:40:17 58982670   d_prod /usr/lib/lpd/pio/etc/pioout -A0 -B43588 -C14688 -F\14\15 
 9-06:35:59  6488798   d_prod /usr/lib/lpd/pio/etc/piohpnpf -x umhs-5picu-ps1 -p 9100 

The date and time looks confusing. Is there a way to make human-readable?

Please advise.

It is human readable, e.g. 19 days, 8 hours, 53 minutes. Anything with a minus sign in field 1 is older than one day.

Yes, it is!!! Thank you!