Is it possible to stop output from a command after bg?

elbarna

Suppose this situation

wget http://file 

wget starts to download file.

I put it in the background.

^Z
bg

The command goes into the background.

But its output is still on the console also -- if the console is still open.

Is it possible to stop the command's output?

Wget is only an example; think about a command which writes a lot of output.

At the console, I know it is possible to do bg and then close terminal and open another, but what if I have only one terminal avaliable and no pseudo-terminals?

PawkyPenguin

Here's a solution that actually redirects the output of a command while it is running: https://superuser.com/questions/732503/redirect-stdout-stderr-of-a-background-job-from-console-to-a-log-file

For a solution that is more usable in an every-day scenario of using a terminal, you could do wget -o log http://file & to run wget in the background and write its output to log instead of your terminal. Of course, you won't see any output at all in this case (even if you ran wget in foreground), but you could do tail -f log to look at the output as it grows.

이 기사는 인터넷에서 수집됩니다. 재 인쇄 할 때 출처를 알려주십시오.

침해가 발생한 경우 연락 주시기 바랍니다[email protected] 삭제

에서 수정
0

몇 마디 만하겠습니다

0리뷰
로그인참여 후 검토

관련 기사

분류에서Dev

Mathematics on output from command line

분류에서Dev

How to stop zsh continuing bg job

분류에서Dev

Scrolling BG missing after coming back from being suspended (iOS-SpriteKit-iphone)

분류에서Dev

How can I stop following output in less, without affecting the command generating the output?

분류에서Dev

How many possible file types in the output `ls -l` command?

분류에서Dev

Cannot view all the output from Windows command

분류에서Dev

how to get the standard output from command in variable

분류에서Dev

Change sound output from command line

분류에서Dev

Is it possible to start a command from bash and send a keystroke to it

분류에서Dev

Is it possible to run rascal programs from the command line?

분류에서Dev

Extract a value from command output and use the value as a parameter to a subsequent command

분류에서Dev

real-time search in terminal output stream; after running a command

분류에서Dev

real-time search in terminal output stream; after running a command

분류에서Dev

Bash command to cut output after x number of lines

분류에서Dev

How to stop MAC address from changing after disconnecting?

분류에서Dev

Luarocks stop working after updating from 2.0.2 to 2.2.0 for windows

분류에서Dev

Why does suffixing an ampersand at the end of a GTK command, result in extra output in the next command after close?

분류에서Dev

Writing a single line command that interprets conditional output from pdbedit

분류에서Dev

shortening the output from the command ps efo cmd | grep

분류에서Dev

Run build command from vim, send output to another tmux pane?

분류에서Dev

Is it possible to keep a command sequence running after sending ctrl+c in the intermediate step?

분류에서Dev

handling command output in python

분류에서Dev

Output a Command Stored in a Variable

분류에서Dev

Undo last command possible?

분류에서Dev

How can I stop Gmail from keeping me logged in after I close the browser?

분류에서Dev

How to stop alert dialog from appearing after every stipulated inactivity time regardless of login/logout status

분류에서Dev

How do I stop a windows from closing after I raise wx.EVT_CLOSE in wxPython?

분류에서Dev

Stop Python Script from Writing to File after it reaches a certain size in linux

분류에서Dev

How can I stop windows re-positioning after waking from sleep?

Related 관련 기사

  1. 1

    Mathematics on output from command line

  2. 2

    How to stop zsh continuing bg job

  3. 3

    Scrolling BG missing after coming back from being suspended (iOS-SpriteKit-iphone)

  4. 4

    How can I stop following output in less, without affecting the command generating the output?

  5. 5

    How many possible file types in the output `ls -l` command?

  6. 6

    Cannot view all the output from Windows command

  7. 7

    how to get the standard output from command in variable

  8. 8

    Change sound output from command line

  9. 9

    Is it possible to start a command from bash and send a keystroke to it

  10. 10

    Is it possible to run rascal programs from the command line?

  11. 11

    Extract a value from command output and use the value as a parameter to a subsequent command

  12. 12

    real-time search in terminal output stream; after running a command

  13. 13

    real-time search in terminal output stream; after running a command

  14. 14

    Bash command to cut output after x number of lines

  15. 15

    How to stop MAC address from changing after disconnecting?

  16. 16

    Luarocks stop working after updating from 2.0.2 to 2.2.0 for windows

  17. 17

    Why does suffixing an ampersand at the end of a GTK command, result in extra output in the next command after close?

  18. 18

    Writing a single line command that interprets conditional output from pdbedit

  19. 19

    shortening the output from the command ps efo cmd | grep

  20. 20

    Run build command from vim, send output to another tmux pane?

  21. 21

    Is it possible to keep a command sequence running after sending ctrl+c in the intermediate step?

  22. 22

    handling command output in python

  23. 23

    Output a Command Stored in a Variable

  24. 24

    Undo last command possible?

  25. 25

    How can I stop Gmail from keeping me logged in after I close the browser?

  26. 26

    How to stop alert dialog from appearing after every stipulated inactivity time regardless of login/logout status

  27. 27

    How do I stop a windows from closing after I raise wx.EVT_CLOSE in wxPython?

  28. 28

    Stop Python Script from Writing to File after it reaches a certain size in linux

  29. 29

    How can I stop windows re-positioning after waking from sleep?

뜨겁다태그

보관