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.
    – Simon
    Commented Jul 9, 2013 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 :)
    – Simon
    Commented Jul 9, 2013 at 8:16

2 Answers 2


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
    Commented Jul 9, 2013 at 13:54
  • @sunil Do you have xdotool installed on the raspberry pi?
    – Seth
    Commented Jul 10, 2013 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
    Commented Oct 9, 2018 at 18:04

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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .