The size of terminal window is defined by the system, so this may change from system to system. For example, in Debian the default size of the terminal is quite big, and it takes almost the whole screen, especially if your machine's screen is small.
However, changing the size of the terminal window on Linux is quite simple. You can do this easily via the resize
command, or simply by using GUI.
In this tutorial, you will learn how to change the default window size of the terminal on Linux
Change Terminal window size with resize
To resize terminal window, you can do so by using the resize
command. resize command allows you to set a custom number of rows and columns.
The syntax of resize command is
resize rows cols
Let's say you want to set a size of 25 rows
and 85 columns
, to do so you can run the command below
resize -s 25 85
Change Terminal window size using GUI
Terminal window size can also be changed by using GUI.
First, launch terminal by pressing CTRL + ALT + T
Next, click to Settings button
Choose "Preferences"
Now in the Preferences window, you need to go to your terminal profile section, simply click to your terminal profile name as shown in the image below
Clicking to Terminal profile name will take you to this window. In this window, you can set a custom size for the window of your terminal.
Changes take effect immediately once you make a change so you can close the window and start using terminal with the new window size.
Set a permanent terminal window size
When using the resize command to change the default size of your terminal window, changes will be lost if you close your terminal window.
To make changes permanent, so you can use the terminal window size that you set even after closing or rebooting your machine, you can do so by adding the resize command into your ~/.bashrc
file
To do this, simply open ~/.bashrc
with a text editor
sudo nano ~/.bashrc
And add the command below to your ~/.bashrc
file
resize -s 24 80
Your ~/.bashrc
should look like this
Next, save changes you made on ~/.bashrc
by pressing CTRL + X , and then confirm by pressing Y.
Conclusion
In this tutorial, you learned how to change the default size of the terminal window on Linux.
We also explained how to make the new terminal size permanent.