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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T07:42:39+00:00 2026-05-11T07:42:39+00:00

In the shell you can do redirection, > < , etc., but how about

  • 0

In the shell you can do redirection, > <, etc., but how about AFTER a program is started?

Here’s how I came to ask this question, a program running in the background of my terminal keeps outputting annoying text. It’s an important process so I have to open another shell to avoid the text. I’d like to be able to >/dev/null or some other redirection so I can keep working in the same shell.

  • 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. 2026-05-11T07:42:39+00:00Added an answer on May 11, 2026 at 7:42 am

    Short of closing and reopening your tty (i.e. logging off and back on, which may also terminate some of your background processes in the process) you only have one choice left:

    • attach to the process in question using gdb, and run:
      • p dup2(open(‘/dev/null’, 0), 1)
      • p dup2(open(‘/dev/null’, 0), 2)
      • detach
      • quit

    e.g.:

    $ tail -f /var/log/lastlog & [1] 5636  $ ls -l /proc/5636/fd total 0 lrwx------ 1 myuser myuser 64 Feb 27 07:36 0 -> /dev/pts/0 lrwx------ 1 myuser myuser 64 Feb 27 07:36 1 -> /dev/pts/0 lrwx------ 1 myuser myuser 64 Feb 27 07:36 2 -> /dev/pts/0 lr-x------ 1 myuser myuser 64 Feb 27 07:36 3 -> /var/log/lastlog  $ gdb -p 5636 GNU gdb 6.8-debian Copyright (C) 2008 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.  Type 'show copying' and 'show warranty' for details. This GDB was configured as 'x86_64-linux-gnu'. Attaching to process 5636 Reading symbols from /usr/bin/tail...(no debugging symbols found)...done. Reading symbols from /lib/librt.so.1...(no debugging symbols found)...done. Loaded symbols for /lib/librt.so.1 Reading symbols from /lib/libc.so.6...(no debugging symbols found)...done. Loaded symbols for /lib/libc.so.6 Reading symbols from /lib/libpthread.so.0...(no debugging symbols found)...done. [Thread debugging using libthread_db enabled] [New Thread 0x7f3c8f5a66e0 (LWP 5636)] Loaded symbols for /lib/libpthread.so.0 Reading symbols from /lib/ld-linux-x86-64.so.2...(no debugging symbols found)...done. Loaded symbols for /lib64/ld-linux-x86-64.so.2  (no debugging symbols found) 0x00007f3c8eec7b50 in nanosleep () from /lib/libc.so.6  (gdb) p dup2(open('/dev/null',0),1) [Switching to Thread 0x7f3c8f5a66e0 (LWP 5636)] $1 = 1  (gdb) p dup2(open('/dev/null',0),2) $2 = 2  (gdb) detach Detaching from program: /usr/bin/tail, process 5636  (gdb) quit  $ ls -l /proc/5636/fd total 0 lrwx------ 1 myuser myuser 64 Feb 27 07:36 0 -> /dev/pts/0 lrwx------ 1 myuser myuser 64 Feb 27 07:36 1 -> /dev/null lrwx------ 1 myuser myuser 64 Feb 27 07:36 2 -> /dev/null lr-x------ 1 myuser myuser 64 Feb 27 07:36 3 -> /var/log/lastlog lr-x------ 1 myuser myuser 64 Feb 27 07:36 4 -> /dev/null lr-x------ 1 myuser myuser 64 Feb 27 07:36 5 -> /dev/null 

    You may also consider:

    • using screen; screen provides several virtual TTYs you can switch between without having to open new SSH/telnet/etc, sessions
    • using nohup; this allows you to close and reopen your session without losing any background processes in the… process.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 124k
  • Answers 124k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Are you running on OS 3.0? I saw the same… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer It looks like you need to register Apache::Session::Memcached with Apache::Session::Wrapper,… May 12, 2026 at 1:19 am
  • Editorial Team
    Editorial Team added an answer Use DATENAME or DATEPART: SELECT DATENAME(dw,GETDATE()) -- Friday SELECT DATEPART(dw,GETDATE())… May 12, 2026 at 1:19 am

Related Questions

In ant you can do something like: <property name=version value=${some.fake.version} <shellscript shell=bash dir=${build.dir}> echo
I'm working on Visual Studio Extensibility and I need to set the shell language
I've created a question about this a few days . My solution is something
I want to put TextA to the beginning of TextB by cat TextA A

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.