Board index SCRIPTS Basic (Small scripts)

How to cut/sort a specific part of the log file

Postby a24uall » Sat Nov 09, 2013 9:40 am

tail -100 /var/log/messages | awk {'print $3'}

Code: Select all
[email protected] [~]# tail -100 /var/log/messages | awk {'print $3'}
21:42:06
21:42:06
21:42:10
21:42:10
Arun
WebhostingDevelopment.com
a24uall
Site Admin
 
Posts: 166
Joined: Sun Jul 01, 2012 9:07 am

Re: How to cut/sort a specific part of the log file

Postby a24uall » Sat Nov 09, 2013 9:42 am

How to SORT the result we have cut just now.

tail -100 /var/log/messages | awk {'print $5'} | sort



[email protected] [~]# tail -100 /var/log/messages | awk {'print $5'} | sort
kernel:
kernel:
kernel:
kernel:
kernel:
kernel:
kernel:
kernel:
kernel:
kernel:
kernel:
kernel:
kernel:
kernel:
kernel:
named[22529]:
named[22529]:
named[22529]:
named[22529]:
named[22529]:
named[22529]:
named[22529]:
named[22529]:
Arun
WebhostingDevelopment.com
a24uall
Site Admin
 
Posts: 166
Joined: Sun Jul 01, 2012 9:07 am


Return to Basic (Small scripts)

Who is online

Users browsing this forum: No registered users and 1 guest


cron