How to delete the user and the machine name in the command prompt on Terminal

For Linux users (or Macs) using Terminal, you will see that the default prompt will have the format [username @ hostname ~] $. For example, on a Dell laptop, bash prompt will display [damien @ damien-dell ~] $, in which 'damien' is the author's username and 'damien-dell' is the server name. Please note that this is only the default setting and you can freely change, as well as show everything you want or even delete the information completely.

The following steps will show you how to do that.

1. In File manager, press Ctrl + H to display hidden files.

2. Open the '.bashrc' file in the text editor.

How to delete the user and the machine name in the command prompt on Terminal Picture 1

3. Find the line starting with PS1 =. The complete line must look like the following:

 PS1='[u@h W]$ ' 

Where u represents the user name, h is the host name and W is the location in the file structure.

How to delete the user and the machine name in the command prompt on Terminal Picture 2

4. To delete the username and server name from the prompt, simply delete the u @ h section, ie the above line will look like this:

 PS1='[W]$ ' 

How to delete the user and the machine name in the command prompt on Terminal Picture 3

5. For those who love pure minimalism, you can delete everything and leave only a prompt:

 PS1='$ ' 

How to delete the user and the machine name in the command prompt on Terminal Picture 4

6. When you have finished editing, save the file.

Now restart your terminal and the changes will be reflected immediately. If you cannot restart the terminal because a session is running, enter the source ~ / .bashrc instead.

Very simple, right? Hope you are succesful.

See more:

  1. How to customize Terminal on Mac
  2. How to run 2 or more Terminal commands at the same time on Linux
  3. Ubuntu Bash tutorial on Windows 10
4 ★ | 5 Vote

May be interested

  • How to Watch Star Wars on Command PromptHow to Watch Star Wars on Command Prompt
    this wikihow teaches you how to watch a version of 'star wars' rendered entirely in ascii characters (by folks with a lot of free time) using command prompt on windows or terminal on mac. open command prompt. you can open command prompt by...
  • How to use Terminal on a MacHow to use Terminal on a Mac
    terminal on mac is a command line interface that allows you to use unix commands to complete some tasks much faster than using a graphical user interface (gui). with the terminal command, you can open files, improve your mac's performance, and more. here's how to use terminal on mac, including some basic commands you can get started.
  • How to Open Terminal in WindowsHow to Open Terminal in Windows
    this wikihow teaches you how to open the command prompt terminal window, using a windows pc. you can open the command prompt from your start menu or from any folder in the file explorer. you can also use the windows run feature. open your...
  • 18 terminal commands on Chromebook you should know18 terminal commands on Chromebook you should know
    do you know that chromebooks have an integrated terminal? chrome os developer shell, or crosh for short, allows users to access the command line interface, which can be used for debugging, testing, etc.
  • How to Delete a File Using Command PromptHow to Delete a File Using Command Prompt
    this wikihow teaches you how to delete a file from your pc's desktop by using a command in command prompt. locate your file. if you know where the file is, you can navigate to it by simply opening the appropriate folder. for example, if...
  • How to save command line output to file on Windows, Mac and LinuxHow to save command line output to file on Windows, Mac and Linux
    when you run a terminal command, it will usually print the output in the terminal so you can read it immediately. however, sometimes you will want to save the output for later analysis or combination with another tool.
  • Guide 5 ways to delete User accounts on Windows 10Guide 5 ways to delete User accounts on Windows 10
    when deleting user accounts that you do not use can free up memory capacity significantly, even your computer runs smoother than the original.
  • How to Get to the Command Line on a MacHow to Get to the Command Line on a Mac
    this wikihow teaches you how to open the terminal (command prompt) application in macos using launchpad, spotlight, or finder. terminal gives you access to the unix part of macos so you can manage files, edit settings, and run scripts...
  • How to Create and Delete Files or Folders from Windows Command PromptHow to Create and Delete Files or Folders from Windows Command Prompt
    this article shows you how to use command prompt on windows to create and delete files and folders (also known as directories). files you create from command prompt can be edited and managed with windows applications, including file manager and text editors.
  • How to customize Windows Terminal applicationHow to customize Windows Terminal application
    with the new windows terminal application, windows finally has a tabbed terminal that can run command prompt, powershell and bash in the same window. and it's highly customizable, you can even set animated gifs as wallpapers.