Day-to-day Problems & Answers

Day-to-day Problems & Answers

Grep files in Linux with Regex

Grep using Regex

grep '2018-03-20 15:55.*ERROR' wso2is-5.0.0/repository/logs/wso2carbon.log

Grep & return line number

grep -n '17:01:39,266' *.c wso2is-5.0.0/repository/logs/wso2carbon.log

RESULT- wso2carbon.log:2776828

Grep & export selected lines range

sed -n '2776828,3015070 p' wso2is-5.0.0/repository/logs/wso2carbon.log  > wso2carbon.log_ERROR_LOG
Posted by Priyanka
Newer Post Older Post Home

All Posts Collection

  • ►  2022 (3)
    • ►  February (1)
    • ►  January (2)
  • ►  2020 (4)
    • ►  July (1)
    • ►  June (2)
    • ►  February (1)
  • ►  2019 (5)
    • ►  June (3)
    • ►  May (2)
  • ▼  2018 (26)
    • ►  December (1)
    • ►  October (1)
    • ►  September (1)
    • ►  August (1)
    • ►  July (2)
    • ►  June (3)
    • ►  May (1)
    • ►  April (2)
    • ▼  March (6)
      • Grep files in Linux with Regex
      • How to delete files more than 3 days old
      • Import Certificates & JKS with WSO2 Products
      • Fix springframework DispatcherServlet in Tomcat & ...
      • Copy Table with indexes
      • CSRF Attack WSO2ESB
    • ►  February (5)
    • ►  January (3)
  • ►  2017 (25)
    • ►  November (2)
    • ►  October (5)
    • ►  September (2)
    • ►  August (3)
    • ►  July (1)
    • ►  June (1)
    • ►  May (1)
    • ►  April (4)
    • ►  March (5)
    • ►  February (1)
  • ►  2013 (4)
    • ►  April (1)
    • ►  March (3)
Awesome Inc. theme. Theme images by Storman. Powered by Blogger.