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 6074211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T10:21:24+00:00 2026-05-23T10:21:24+00:00

I connect to my rooted phone through adb shell command and I run the

  • 0

I connect to my rooted phone through adb shell command and I run
the vmstat command so as to watch various system resources. Is
there a way to redirect vmstat’s output to a file. I tried:

vmstat > /sdcard/vmstat_output.txt

but it doesn’t work.. It creates the file but there is no data inside..

Any ideas?

  • 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-23T10:21:25+00:00Added an answer on May 23, 2026 at 10:21 am

    Ok, I fixed the problem. I download the source from here and I added one extra line:

    fflush(stdout);
    

    right after the print_line command (line: 134). Then, I cross-compiled the vmstat.c with
    agcc:

    agcc vmstat.c -o vmstat
    

    and put the file to the /sdcard/ through the adb:

    adb push vmstat /sdcard/
    

    Now the redirection works
    perfectly, as after every print_line call, the data are flushed to the file. As Mark Polhamus mentioned,
    the problem was the fact that vmstat is a block-buffered command, which means that a buffer
    has to be filled with data first and then this data will be flushed to the file..

    Thank you very much Mark! 🙂

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Facebook Connect seems like the cool new way to leverage a user's Facebook account
I connect to a running node with the -remsh flag, and I run my
Connect function returns after sending the last ACK(3rd segment of 3-way handshake of initiating
I connect to my server through SSH in Terminal.app to use Vim to edit
Connect the apache config files with the command: include / usr / local /
I connect to some program via COM and receive System.__ComObject. I know several methods
I connect to the linux server via putty SSH. I tried to run it
I connect my android phone to eclipse. And I see these message from Logcat.
Facebook Connect and their Social Widgets documentation mention that you need to add an
We connect to the repository by ip address - a quick hack introduced by

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.