[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Osaka/Yokohama/Tokushima] Looking for infrastructure/server side engineers!

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Deployed by over 500 companies] AWS construction, operation, maintenance, and monitoring services

[Successor to CentOS] AlmaLinux OS server construction/migration service

[Successor to CentOS] AlmaLinux OS server construction/migration service

[For WordPress only] Cloud server “Web Speed”

[For WordPress only] Cloud server “Web Speed”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Cheap] Website security automatic diagnosis “Quick Scanner”

[Reservation system development] EDISONE customization development service

[Reservation system development] EDISONE customization development service

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Registration of 100 URLs is 0 yen] Website monitoring service “Appmill”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[Compatible with over 200 countries] Global eSIM “Beyond SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[If you are traveling, business trip, or stationed in China] Chinese SIM service “Choco SIM”

[Global exclusive service] Beyond's MSP in North America and China

[Global exclusive service] Beyond's MSP in North America and China

[YouTube] Beyond official channel “Biyomaru Channel”

[YouTube] Beyond official channel “Biyomaru Channel”

I tried changing the settings of the MacOS standard terminal!

Terminal

hello everyone!
This is Futa from the System Solutions Department.
Are you making preparations for a comfortable life, such as installing heating equipment, as winter approaches?


, we will introduce you to a comfortable command life using the MacBook OS standard terminal (Terminal.app)
, which is one of the terminal emulators that is the basis for using commands I would like to pick up some settings for the OS standard terminal (Terminal.app) and configure them based on this theme.
Having said that, I have installed iTerm2 lol
If you search for "Mac terminal", there are many articles about iTerm2, so if you are interested, please search there as well.

introduction

environment

Hardware: MacBook Air
Chip: Apple M1
Shell: zsh (also partially uses bash)

What exactly is a terminal?

If you already know this, please click and skip reading.

When I googled it...

It is software that imitates a dedicated terminal (physically existing) and realizes its functions, and is expressed as a terminal emulator, terminal software, virtual terminal, etc.
You can use the keyboard to issue commands to the OS and applications.

It can be controlled remotely using commands, and characters entered into the terminal are transferred to a remote computer and executed.
Furthermore, the characters output on the remote computer are sent back to the terminal and displayed on the terminal software screen.

It's software that imitates devices that perform input/output and communication with a computer!

Change the appearance of prompts

First, let's check the prompt display.
It is set in the environment variable PS1

echo $PS1

There are many types of parameters, and the description content differs depending on the shell, so I will only describe some of them here.
If you are interested, please try setting it according to your preference.

■zsh parameters
%n username
%m host name
%1~ Current directory (only)
%~ Current directory (full path)
%# User type (# for root, % for non-root)
%F{color number}parameter to add color%f Color setting for parameters
■bash parameters
\u username
\h host name
\W Current directory (only)
\w Current directory (full path)
\$ User type (# for root, $ for non-root)
\[\e\[Color number m\] Start setting color scheme for parameters
\[\e\[m\] Finish and start setting color scheme for parameters

For the local environment (zsh), set the following parameters.

PS1='%n@%m:%~%#'

It will look like below!

futa@futa-dev:~%echo $PS1 %n@%m:%~%#

In a CUI where only text is displayed, knowing information such as the current directory (working directory) and logged-in user helps prevent human errors.
You can check the current directory with the pwd command and the current user with the whoami command, but you can work more comfortably and safely by setting them in advance!
When logging into a server, I think changing the display for each server will reduce mistakes, so please refer to the article below!
[Linux] Cool thing that appears when logging in with SSH (/etc/motd)
This time, we only changed the displayed content, but you can do various things such as setting colors, decorations, line breaks, etc. If you have one, please try the challenge.
(The following is a bash environment, so "% -> $" represents a general user.)
Example of change

Transparent terminal background

By default, the background of the terminal is opaque, which is somewhat inconvenient when entering commands while referring to data or articles. .
Therefore, the background will be transparent!

Terminal > Settings > Profile > Background (color effect) >
Change the opacity value to your liking.

(Example) Opacity 80%

Personally, I often work while checking and referring to something, so I made it a little more transparent.
Now you can work while looking at the documents on the back!
You can also set the font type, size, cursor customization, etc. from ``Terminal > Settings > Profile'', so please try changing it to your preference.

split screen

Finally, split the screen.
In fact, in the OS standard terminal (Terminal.app), the operation contents are synchronized when the screen is split.
To work with multiple screens displayed, you need to open a new window (or tab), so this may be the difference for those who dare to use another terminal such as iTerm2.
Even so, it is useful if you only need to work while checking logs, etc., so being able to display multiple screens will improve your work efficiency.

Here are some rough shortcuts regarding screen splitting!

split screen Command + d
Cancel split screen Command + Shift + d
open tab Command+t
Move between tabs Control+Tab
close tab Command+w

Don't mistake "Command + d (split screen)" and "Control + d (logout)". .
If you are interested in other shortcuts, please check the link below!
Mac Terminal keyboard shortcuts

Some people use iTerm2 for their own preferences, such as starting a terminal or splitting the screen, but please try customizing the standard terminal to your liking!

If you found this article helpful , please give it a like!
6
Loading...
6 votes, average: 1.00 / 16
934
X facebook Hatena Bookmark pocket
[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

[2025.6.30 Amazon Linux 2 support ended] Amazon Linux server migration solution

The person who wrote this article

About the author

Fouta

I belong to the System Solutions Department.
I like udon.
I also like sports.