23

How can I minimize the Terminal window using a command? For example: I use the clear command to clear the terminal output, which command can I have to use to minimize the terminal window?

  • ss64.com/bash is a good bash reference, but it does not mention window placement or display. – SimplySimon Jul 9 '13 at 8:11
  • 1
    Atually bg %0 where 0 is the pid of the Terminal Window would send it to the background, not quite the same, but similar :) – SimplySimon Jul 9 '13 at 8:16
24

You could use this command:

xdotool windowminimize $(xdotool getactivewindow)

You can change xdotool getactivewindow with a specific window that you would like to minimize.

xdotool wouldn't be installed on Ubuntu by default.So run the below command to install xdotool package.

sudo apt-get install xdotool
  • 2
    same command Will not work in Raspberry pi..???? – sunil Jul 9 '13 at 13:54
  • @sunil Do you have xdotool installed on the raspberry pi? – Seth Jul 10 '13 at 1:42
  • You can actually chain the 2 xdotool commands in one (instead of running xdotool twice). Ref: ubuntuforums.org/showthread.php?t=2214221 (tried on Ubuntu 16.04) Command: xdotool getactivewindow windowminimize – Champ Oct 9 '18 at 18:04
0

If you are using the byobu terminal, you can press F6 to detach from the current session. This will have the effect of closing the window, but continuing to run byobu and all its subprograms in the background. To reattach to that session, just run byobu again as you normally would.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.