Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

241
Views
Is "docker logs container-id | tail -10" a valid command?

I'm running the command docker logs <container-id> | tail -10 and still, docker shows the entire log history. I know docker logs --tail 10 <container-id> is a valid command and serves the purpose. But, why doesn't the former command works as it does in case of a file?

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

If you want your everything your program writes to either stdout or stderr to go through the pipeline to tail, redirect stderr to stdout:

docker logs "$container_id" 2>&1 | tail -10
over 4 years ago · Santiago Trujillo Report

0

in case someone may want to tail -f docker logs

here you may try this:

docker logs -f --tail 0 "$container_id"
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!