Operations 6 min read

Customize Your Linux Prompt with Starship: A Step‑by‑Step Guide

This guide explains how to install the Rust‑based Starship prompt, add it to Bash, create a basic TOML configuration, and customize its appearance across Linux, macOS, and Windows shells, providing practical commands and examples for a sleek, fast terminal experience.

Liangxu Linux
Liangxu Linux
Liangxu Linux
Customize Your Linux Prompt with Starship: A Step‑by‑Step Guide

Starship is an open‑source, Rust‑written tool that lets you build a minimal, fast, and highly customizable shell prompt that works across Bash, Fish, PowerShell, and other shells.

Key Features

Cross‑platform support

Cross‑shell compatibility

Custom commands and Git integration

Language‑specific modules

Low performance impact

Installation on Linux

Install Starship by downloading a script and running it as root, or use the Snap package.
sudo snap install starship

Ensure the Nerd Font is installed for full visual support.

Prerequisites

You need curl to fetch the installer script. sudo apt install curl Then run the official install script:

curl -fsSL https://starship.rs/install.sh | bash

Adding Starship to Bash

Append the initialization line to the end of your .bashrc file: eval "$(starship init bash)" To edit the file quickly: nano .bashrc After adding the line, restart the terminal or source the file to see the new prompt.

Basic Configuration

Create a TOML configuration file at ~/.config/starship.toml:

mkdir -p ~/.config && touch ~/.config/starship.toml

In this file you can define modules, colors, symbols, and conditional displays. A simple example configuration might look like this (shown in the original screenshots):

# Example starship.toml content
[character]
symbol = "➜ "

You can further customize the prompt by adding icons, emojis, or language‑specific modules, and by adjusting format strings to show Git status, command duration, and more.

Conclusion

Starship provides a powerful yet lightweight way to personalize your terminal prompt with minimal effort, suitable for any standard shell on various operating systems. While the full documentation can be extensive, the basic steps above give you a functional, sleek prompt that you can extend as needed.

Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

LinuxBashcustomizationterminalStarshipshell prompt
Liangxu Linux
Written by

Liangxu Linux

Liangxu, a self‑taught IT professional now working as a Linux development engineer at a Fortune 500 multinational, shares extensive Linux knowledge—fundamentals, applications, tools, plus Git, databases, Raspberry Pi, etc. (Reply “Linux” to receive essential resources.)

0 followers
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.