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

  • SEARCH
  • Home
  • 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 3459748
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T10:08:43+00:00 2026-05-18T10:08:43+00:00

I know chances are extremely low, but is there a way to see what

  • 0

I know chances are extremely low, but is there a way
to see what a nohup-ed process has been outputting recently?

I still have this process open but I’ve run it with redirecting all output to /dev/null.

So is there a way to recover such process back to console, or is it hopeless 🙁

Cheers

  • 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-18T10:08:44+00:00Added an answer on May 18, 2026 at 10:08 am

    There is a way but it isn’t straight forward, the trick is to use dup2 and depends on the fact that your program is linked against libc (which all c/c++ applications would be, but a java application wouldn’t be for example)

    1. attach to your process using gdb
    2. run the following at the gdb prompt to redirect stdout to /tmp/newfile

      $ print dup2(open(“/tmp/newfile”,0), 1)

    3. run the following to redirect stderr to /tmp/newfile

      $ print dup2(open(“/tmp/newfile”,0), 2)

    4. detach gdb from your process and your done

    What dup2 does is

    duplicate a file descriptor
    This means that both stdout/stderr (1 and 2) and the new file descriptor returned from open can be used interchangeable which will cause all output going to stdout and stderr to go to the file you opened.

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

Sidebar

Related Questions

Does anyone know if there have been any changes in Azure publish to allow
I understand that this question has likely been asked, but I don't understand the
Objective-C categories are extremely useful, but there are some problems with this power. These
I know this is extremely basic, but I am editing a wordpress plugin for
I know how to view all changes in a changeset.. But let's say you
I know there is a command that updates the changes like c:\svn up <working
Just wanted to know if there is a big chance to inject SQL While
I know that snapshot isolation would fix this problem, but I'm wondering if NOLOCK
FYI: I have edited this significantly since my first edition. This simulation has been
Don't know if this is the right place to ask this, but I will

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.