Monday, 22 June 2015

Grepping file based on month + perl + one liner

# ls -l | perl -ne '@s=split(" ");if(($s[5] eq "May")&&($s[6] > 27)) {print}'

[root@centos64 ~]# ls -l | perl -ne '@s=split(" ");if(($s[5] eq "May")&&($s[6] > 27)) {print}'
-rw-r--r--  1 root root    284857 May 28 05:45 apr-1.5.0-1.x86_64.rpm
-rw-r--r--  1 root root   1072141 May 28 05:45 apr-devel-1.5.0-1.x86_64.rpm
-rw-r--r--  1 root root     77504 May 28 05:45 apr-util-1.5.3-1.x86_64.rpm
-rw-r--r--  1 root root    489168 May 28 05:45 apr-util-devel-1.5.3-1.x86_64.rpm
-rw-r--r--  1 root root   3684645 May 28 05:45 httpd-2.4.12-1.x86_64.rpm
-rw-r--r--  1 root root    203249 May 28 05:45 httpd-devel-2.4.12-1.x86_64.rpm
-rw-r--r--  1 root root   4226183 May 28 05:45 httpd-manual-2.4.12-1.x86_64.rpm
-rw-r--r--  1 root root    152418 May 28 05:45 httpd-tools-2.4.12-1.x86_64.rpm
-rw-r--r--  1 root root    129045 May 28 05:45 mod_lua-2.4.12-1.x86_64.rpm
You have mail in /var/spool/mail/root


No comments:

Post a Comment