how to change xyz@abc where i need to change xyz when terminal starts [duplicate]












0
















This question already has an answer here:




  • How can I shorten my command line (bash) prompt?

    5 answers



  • Change the terminal prompt [duplicate]

    2 answers




Every time I open my terminal, I see xyz@abc where I type my sudo commands.However, my concern is this xyz and I want to change it to the name of my choice. I am unaware of the technical term for this and also the steps to do this.I am using ubuntu 18.04.










share|improve this question













marked as duplicate by Sergiy Kolodyazhnyy command-line
Users with the  command-line badge can single-handedly close command-line questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 19 at 9:19


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • xyz is your username.

    – GabrielaGarcia
    Jan 19 at 9:10
















0
















This question already has an answer here:




  • How can I shorten my command line (bash) prompt?

    5 answers



  • Change the terminal prompt [duplicate]

    2 answers




Every time I open my terminal, I see xyz@abc where I type my sudo commands.However, my concern is this xyz and I want to change it to the name of my choice. I am unaware of the technical term for this and also the steps to do this.I am using ubuntu 18.04.










share|improve this question













marked as duplicate by Sergiy Kolodyazhnyy command-line
Users with the  command-line badge can single-handedly close command-line questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 19 at 9:19


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.



















  • xyz is your username.

    – GabrielaGarcia
    Jan 19 at 9:10














0












0








0









This question already has an answer here:




  • How can I shorten my command line (bash) prompt?

    5 answers



  • Change the terminal prompt [duplicate]

    2 answers




Every time I open my terminal, I see xyz@abc where I type my sudo commands.However, my concern is this xyz and I want to change it to the name of my choice. I am unaware of the technical term for this and also the steps to do this.I am using ubuntu 18.04.










share|improve this question















This question already has an answer here:




  • How can I shorten my command line (bash) prompt?

    5 answers



  • Change the terminal prompt [duplicate]

    2 answers




Every time I open my terminal, I see xyz@abc where I type my sudo commands.However, my concern is this xyz and I want to change it to the name of my choice. I am unaware of the technical term for this and also the steps to do this.I am using ubuntu 18.04.





This question already has an answer here:




  • How can I shorten my command line (bash) prompt?

    5 answers



  • Change the terminal prompt [duplicate]

    2 answers








command-line hostname






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 19 at 8:24









satyajeet jhasatyajeet jha

1011




1011




marked as duplicate by Sergiy Kolodyazhnyy command-line
Users with the  command-line badge can single-handedly close command-line questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 19 at 9:19


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by Sergiy Kolodyazhnyy command-line
Users with the  command-line badge can single-handedly close command-line questions as duplicates and reopen them as needed.

StackExchange.ready(function() {
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function() {
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function() {
$hover.showInfoMessage('', {
messageElement: $msg.clone().show(),
transient: false,
position: { my: 'bottom left', at: 'top center', offsetTop: -7 },
dismissable: false,
relativeToBody: true
});
},
function() {
StackExchange.helpers.removeMessages();
}
);
});
});
Jan 19 at 9:19


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.















  • xyz is your username.

    – GabrielaGarcia
    Jan 19 at 9:10



















  • xyz is your username.

    – GabrielaGarcia
    Jan 19 at 9:10

















xyz is your username.

– GabrielaGarcia
Jan 19 at 9:10





xyz is your username.

– GabrielaGarcia
Jan 19 at 9:10










1 Answer
1






active

oldest

votes


















1














What you see (xyz@abc) is the bash prompt:




  • xyz is the username


  • abc is the hostname



You can tune it by modifying the variable PS1 in the file ~/.bashrc. You may see the Ubuntu documentation: Customizing Bash Prompt.



Simply open ~/.bashrc file in a text editor like nano, create new line filled with a copy of the PS1 definition. For your need, you will replace the u username tag by coco if you want to see coco in place of xyz.



Inside of ~/.bashrc:





if [ "$color_prompt" = yes ]; then
#PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[00m]$ '
PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]coco@h[33[00m]:[33[01;34m]w[33[00m]$ '
else
#PS1='${debian_chroot:+($debian_chroot)}u@h:w$ '
PS1='${debian_chroot:+($debian_chroot)}coco@h:w$ '
fi


Some readings:




  • How to: Change / Setup bash custom prompt (PS1)


  • .bashrc PS1 generator







share|improve this answer
































    1 Answer
    1






    active

    oldest

    votes








    1 Answer
    1






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes









    1














    What you see (xyz@abc) is the bash prompt:




    • xyz is the username


    • abc is the hostname



    You can tune it by modifying the variable PS1 in the file ~/.bashrc. You may see the Ubuntu documentation: Customizing Bash Prompt.



    Simply open ~/.bashrc file in a text editor like nano, create new line filled with a copy of the PS1 definition. For your need, you will replace the u username tag by coco if you want to see coco in place of xyz.



    Inside of ~/.bashrc:





    if [ "$color_prompt" = yes ]; then
    #PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[00m]$ '
    PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]coco@h[33[00m]:[33[01;34m]w[33[00m]$ '
    else
    #PS1='${debian_chroot:+($debian_chroot)}u@h:w$ '
    PS1='${debian_chroot:+($debian_chroot)}coco@h:w$ '
    fi


    Some readings:




    • How to: Change / Setup bash custom prompt (PS1)


    • .bashrc PS1 generator







    share|improve this answer






























      1














      What you see (xyz@abc) is the bash prompt:




      • xyz is the username


      • abc is the hostname



      You can tune it by modifying the variable PS1 in the file ~/.bashrc. You may see the Ubuntu documentation: Customizing Bash Prompt.



      Simply open ~/.bashrc file in a text editor like nano, create new line filled with a copy of the PS1 definition. For your need, you will replace the u username tag by coco if you want to see coco in place of xyz.



      Inside of ~/.bashrc:





      if [ "$color_prompt" = yes ]; then
      #PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[00m]$ '
      PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]coco@h[33[00m]:[33[01;34m]w[33[00m]$ '
      else
      #PS1='${debian_chroot:+($debian_chroot)}u@h:w$ '
      PS1='${debian_chroot:+($debian_chroot)}coco@h:w$ '
      fi


      Some readings:




      • How to: Change / Setup bash custom prompt (PS1)


      • .bashrc PS1 generator







      share|improve this answer




























        1












        1








        1







        What you see (xyz@abc) is the bash prompt:




        • xyz is the username


        • abc is the hostname



        You can tune it by modifying the variable PS1 in the file ~/.bashrc. You may see the Ubuntu documentation: Customizing Bash Prompt.



        Simply open ~/.bashrc file in a text editor like nano, create new line filled with a copy of the PS1 definition. For your need, you will replace the u username tag by coco if you want to see coco in place of xyz.



        Inside of ~/.bashrc:





        if [ "$color_prompt" = yes ]; then
        #PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[00m]$ '
        PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]coco@h[33[00m]:[33[01;34m]w[33[00m]$ '
        else
        #PS1='${debian_chroot:+($debian_chroot)}u@h:w$ '
        PS1='${debian_chroot:+($debian_chroot)}coco@h:w$ '
        fi


        Some readings:




        • How to: Change / Setup bash custom prompt (PS1)


        • .bashrc PS1 generator







        share|improve this answer















        What you see (xyz@abc) is the bash prompt:




        • xyz is the username


        • abc is the hostname



        You can tune it by modifying the variable PS1 in the file ~/.bashrc. You may see the Ubuntu documentation: Customizing Bash Prompt.



        Simply open ~/.bashrc file in a text editor like nano, create new line filled with a copy of the PS1 definition. For your need, you will replace the u username tag by coco if you want to see coco in place of xyz.



        Inside of ~/.bashrc:





        if [ "$color_prompt" = yes ]; then
        #PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]u@h[33[00m]:[33[01;34m]w[33[00m]$ '
        PS1='${debian_chroot:+($debian_chroot)}[33[01;32m]coco@h[33[00m]:[33[01;34m]w[33[00m]$ '
        else
        #PS1='${debian_chroot:+($debian_chroot)}u@h:w$ '
        PS1='${debian_chroot:+($debian_chroot)}coco@h:w$ '
        fi


        Some readings:




        • How to: Change / Setup bash custom prompt (PS1)


        • .bashrc PS1 generator








        share|improve this answer














        share|improve this answer



        share|improve this answer








        edited Jan 19 at 9:23









        pa4080

        14.1k52665




        14.1k52665










        answered Jan 19 at 9:14









        cmak.frcmak.fr

        1,7341019




        1,7341019















            Popular posts from this blog

            How to make a Squid Proxy server?

            Is this a new Fibonacci Identity?

            19世紀