+4 votes
223 views
Customize the Ubuntu Linux terminal

in Linux / Unix by (552k points)
reopened | 223 views

1 Answer

+5 votes
Best answer

image


The first thing to know is that the terminal uses profiles where it will store the configuration changes made. To create a profile we must go to the menu and choose "edit", "profiles" and select "new", assign a name to the new profile and choose to create.




image


Now we can modify the configuration of the profile called "New".

Change the typeface

To change the font type choose the general tab and select the font type and size in the "Font" section. In this tab we can also change the name of the profile and the number of columns and lines that will be displayed in the terminal.




image


Change the cursor type

It is possible to choose the shape of the course by modifying the option "Cursor shape".

Change text colors

In the colors tab we can modify the color of the text, the background color of the text manually or by choosing a default color scheme.




image


Change the background

The "Background" tab allows us to change the background color of the terminal, place a background image and convert the transparent background.




image


Change the scroll bar (Scroll bar)

The Scrolling tab allows us to choose which side the scroll bar will be displayed and the number of lines it will store.




image


With these changes we can obtain a visual, different and personalized, now we will add some features to the so-called "Prompt".

What is the prompt?

The prompt is the text that appears before the "$" sign each time you enter a command. By default in the terminal something like this will appear:




image


Change the prompt

To modify the prompt we open a terminal and write the command "export PS1 =" du @ hw $ "and the prompt will be displayed like this:




image


Where:

d Displays the date with the format "day of the week, month and day number"
u Name of the current user.
h Displays the name of the host.
w Name of the current directory.
$ If you are superuser shows a # if not, shows a $

In addition to these variables, the following can be used:

H Displays host name and domain
n Line break
r Returns to the beginning of the line
s Show the name of the command interpreter
t Displays the time in 24-hour format
T Displays the time in 12-hour format
@ Display the time in 12-hour format with am or pm indicator
v Version of the command interpreter
V Distribution of the command interpreter
W Name of the current directory trimmed
! Number in the history of the typed command
# Typed command number

Try several combinations according to the information that is useful to have. Here are some examples:

The command: export PS1 = " T w $ " will show:




image
The command: export PS1 = " or w d @ $ " will show:




image
Finally it is also possible to change the color of the text in the prompt by adding the color code corresponding to the previous commands.

Color / Code
Black [e [0; 30m]
Dark gray [e [1; 30m]
Red [e [0; 31m]
Light red [e [1; 31m]
Green [e [0; 32m]
Light green [e [1; 32m]
Brown [e [0; 33m]
Yellow [e [1; 33m]
Blue [e [0; 34m]
Light blue [e [1; 34m]
Purple [e [0; 35m]
Light purple [e [1; 35m]
Cyan [e [0; 36m]
Clear Cyan [e [1; 36m]
Light gray [e [0; 37m]
White [e [1; 37m]



With these changes you can customize the terminal to your taste and needs.

by (3.5m points)
edited

Related questions

+4 votes
1 answer
asked Jun 2, 2020 in Linux / Unix by backtothefuture (552k points) | 335 views
+5 votes
1 answer
asked Nov 12, 2020 in Linux / Unix by backtothefuture (552k points) | 332 views
+3 votes
1 answer
asked Oct 19, 2020 in Linux / Unix by backtothefuture (552k points) | 338 views
+3 votes
1 answer
asked Oct 19, 2020 in Linux / Unix by backtothefuture (552k points) | 664 views
+4 votes
1 answer
asked Sep 18, 2020 in Linux / Unix by backtothefuture (552k points) | 566 views
Sponsored articles cost $40 per post. You can contact us via Feedback

Most popular questions within the last 30 days

10,659 questions
10,791 answers
510 comments
3 users