Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6813885
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T20:37:20+00:00 2026-05-26T20:37:20+00:00

The following command is working as expected. What I need to find is the

  • 0

The following command is working as expected. What I need to find is the thread id that is available in the first or third column.

# tail -1000 general.log | grep Connect | egrep -v "(abc|slave_user)"
                2856057 Connect root@localhost on 
111116  5:14:01 2856094 Connect root@localhost on 

If the line starts with the date, select the third column i.e. 2856094 or the first column i.e. 2856057

Expected output:
2856057
2856094
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T20:37:21+00:00Added an answer on May 26, 2026 at 8:37 pm

    Another way to look at it is that you always take the fourth column when counting from the right:

    awk '{ print $(NF-3) }'
    

    Otherwise, if the date is really the only reliable indicator, try this:

    awk -v Date=$(date "+%y%m%d") '$1 == Date { print $3; next } { print $1 }'
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following command is working as expected... find /var/lib/mysql -name *.csv -or -name *.txt
I have the following command which deletes files that are one day old and
The following is working as expected. I want to replace the word me with
The following is working as expected. scp -o IdentityFile=/home/companyuser/.ssh/id_dsa_fner {} companyuser@14.140.100.189:/home/fner/ But the rsync
is the following command working under Unix&Linux? ProcessBuilder prcbdoc = new ProcessBuilder(cmd,/C,start, Documentation.doc); prcbdoc.directory(new
I have the following 2 commands working as expected. grep -B3 'Max_value: 127' proc_*.*
jQuery trim not working. I wrote the following command to remove white space. Whats
Following command will let me know the names of databases. $ mysqlshow But how
The following command gives many manuals of Zsh man zsh<tab> alt text http://dl.getdropbox.com/u/175564/zsh.png I
The following command causes an exception. cv::imwrite(test.jpg, diffImg); I also tried numerous variations on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.