Changing the prompt in Ubuntu
Clash Royale CLAN TAG#URR8PPP
The line that I type in on Ubuntu looks like this:
username@DESKTOP-FOO:~$
when I want it to look like this:
username@userPC:~$
How do I fix it?
linux prompt
add a comment |
The line that I type in on Ubuntu looks like this:
username@DESKTOP-FOO:~$
when I want it to look like this:
username@userPC:~$
How do I fix it?
linux prompt
1
Are you using some virtualization on your "userPC" to create an Ubuntu environment, such as kvm or docker?
– Jeff Schaller
Feb 7 at 0:26
username@DESKTOP-FOO:~$
is a command prompt .... it is not something that you type .... please try to clarify your post
– jsotola
Feb 7 at 3:19
why do you want the command prompt to beusername@userPC:~$
?
– jsotola
Feb 7 at 3:33
"DESKTOP-FOO" is the hostname of your computer. You can simply change it.
– RoVo
Feb 7 at 7:30
add a comment |
The line that I type in on Ubuntu looks like this:
username@DESKTOP-FOO:~$
when I want it to look like this:
username@userPC:~$
How do I fix it?
linux prompt
The line that I type in on Ubuntu looks like this:
username@DESKTOP-FOO:~$
when I want it to look like this:
username@userPC:~$
How do I fix it?
linux prompt
linux prompt
edited Feb 7 at 7:24
Rui F Ribeiro
40.7k1479137
40.7k1479137
asked Feb 6 at 23:19
unknown_9unknown_9
1
1
1
Are you using some virtualization on your "userPC" to create an Ubuntu environment, such as kvm or docker?
– Jeff Schaller
Feb 7 at 0:26
username@DESKTOP-FOO:~$
is a command prompt .... it is not something that you type .... please try to clarify your post
– jsotola
Feb 7 at 3:19
why do you want the command prompt to beusername@userPC:~$
?
– jsotola
Feb 7 at 3:33
"DESKTOP-FOO" is the hostname of your computer. You can simply change it.
– RoVo
Feb 7 at 7:30
add a comment |
1
Are you using some virtualization on your "userPC" to create an Ubuntu environment, such as kvm or docker?
– Jeff Schaller
Feb 7 at 0:26
username@DESKTOP-FOO:~$
is a command prompt .... it is not something that you type .... please try to clarify your post
– jsotola
Feb 7 at 3:19
why do you want the command prompt to beusername@userPC:~$
?
– jsotola
Feb 7 at 3:33
"DESKTOP-FOO" is the hostname of your computer. You can simply change it.
– RoVo
Feb 7 at 7:30
1
1
Are you using some virtualization on your "userPC" to create an Ubuntu environment, such as kvm or docker?
– Jeff Schaller
Feb 7 at 0:26
Are you using some virtualization on your "userPC" to create an Ubuntu environment, such as kvm or docker?
– Jeff Schaller
Feb 7 at 0:26
username@DESKTOP-FOO:~$
is a command prompt .... it is not something that you type .... please try to clarify your post– jsotola
Feb 7 at 3:19
username@DESKTOP-FOO:~$
is a command prompt .... it is not something that you type .... please try to clarify your post– jsotola
Feb 7 at 3:19
why do you want the command prompt to be
username@userPC:~$
?– jsotola
Feb 7 at 3:33
why do you want the command prompt to be
username@userPC:~$
?– jsotola
Feb 7 at 3:33
"DESKTOP-FOO" is the hostname of your computer. You can simply change it.
– RoVo
Feb 7 at 7:30
"DESKTOP-FOO" is the hostname of your computer. You can simply change it.
– RoVo
Feb 7 at 7:30
add a comment |
1 Answer
1
active
oldest
votes
Although I do not fully understand your concern I can show you how you change the prompt in general.
There is an environment variable PS1
that is used by your ~/.bashrc
file. This variable should contain this by default:
[e]0;u@h: wa]$debian_chroot:+($debian_chroot)u@h:w$
Now you can feel free to edit this variable like this:
PS1="[e]0;u@h: wa]$debian_chroot:+($debian_chroot)u@userPC:w$"
It is not really elegant to do so but I did not understand where the "userPC
" came from. The default (h
) takes your current hostname for the command line prompt.
This is however just for your current session.
If you want to make this permanent you should add the line stated above to your ~/.bashrc
file. Then it will be read automatically on logging in to a terminal.
I hope this helps you solving your problem.
@Kusalananda You are right. Thank you I will edit my post.
– majesticLSD
Feb 7 at 7:37
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f499183%2fchanging-the-prompt-in-ubuntu%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Although I do not fully understand your concern I can show you how you change the prompt in general.
There is an environment variable PS1
that is used by your ~/.bashrc
file. This variable should contain this by default:
[e]0;u@h: wa]$debian_chroot:+($debian_chroot)u@h:w$
Now you can feel free to edit this variable like this:
PS1="[e]0;u@h: wa]$debian_chroot:+($debian_chroot)u@userPC:w$"
It is not really elegant to do so but I did not understand where the "userPC
" came from. The default (h
) takes your current hostname for the command line prompt.
This is however just for your current session.
If you want to make this permanent you should add the line stated above to your ~/.bashrc
file. Then it will be read automatically on logging in to a terminal.
I hope this helps you solving your problem.
@Kusalananda You are right. Thank you I will edit my post.
– majesticLSD
Feb 7 at 7:37
add a comment |
Although I do not fully understand your concern I can show you how you change the prompt in general.
There is an environment variable PS1
that is used by your ~/.bashrc
file. This variable should contain this by default:
[e]0;u@h: wa]$debian_chroot:+($debian_chroot)u@h:w$
Now you can feel free to edit this variable like this:
PS1="[e]0;u@h: wa]$debian_chroot:+($debian_chroot)u@userPC:w$"
It is not really elegant to do so but I did not understand where the "userPC
" came from. The default (h
) takes your current hostname for the command line prompt.
This is however just for your current session.
If you want to make this permanent you should add the line stated above to your ~/.bashrc
file. Then it will be read automatically on logging in to a terminal.
I hope this helps you solving your problem.
@Kusalananda You are right. Thank you I will edit my post.
– majesticLSD
Feb 7 at 7:37
add a comment |
Although I do not fully understand your concern I can show you how you change the prompt in general.
There is an environment variable PS1
that is used by your ~/.bashrc
file. This variable should contain this by default:
[e]0;u@h: wa]$debian_chroot:+($debian_chroot)u@h:w$
Now you can feel free to edit this variable like this:
PS1="[e]0;u@h: wa]$debian_chroot:+($debian_chroot)u@userPC:w$"
It is not really elegant to do so but I did not understand where the "userPC
" came from. The default (h
) takes your current hostname for the command line prompt.
This is however just for your current session.
If you want to make this permanent you should add the line stated above to your ~/.bashrc
file. Then it will be read automatically on logging in to a terminal.
I hope this helps you solving your problem.
Although I do not fully understand your concern I can show you how you change the prompt in general.
There is an environment variable PS1
that is used by your ~/.bashrc
file. This variable should contain this by default:
[e]0;u@h: wa]$debian_chroot:+($debian_chroot)u@h:w$
Now you can feel free to edit this variable like this:
PS1="[e]0;u@h: wa]$debian_chroot:+($debian_chroot)u@userPC:w$"
It is not really elegant to do so but I did not understand where the "userPC
" came from. The default (h
) takes your current hostname for the command line prompt.
This is however just for your current session.
If you want to make this permanent you should add the line stated above to your ~/.bashrc
file. Then it will be read automatically on logging in to a terminal.
I hope this helps you solving your problem.
edited Feb 7 at 7:38
answered Feb 7 at 7:01
majesticLSDmajesticLSD
763
763
@Kusalananda You are right. Thank you I will edit my post.
– majesticLSD
Feb 7 at 7:37
add a comment |
@Kusalananda You are right. Thank you I will edit my post.
– majesticLSD
Feb 7 at 7:37
@Kusalananda You are right. Thank you I will edit my post.
– majesticLSD
Feb 7 at 7:37
@Kusalananda You are right. Thank you I will edit my post.
– majesticLSD
Feb 7 at 7:37
add a comment |
Thanks for contributing an answer to Unix & Linux Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f499183%2fchanging-the-prompt-in-ubuntu%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
1
Are you using some virtualization on your "userPC" to create an Ubuntu environment, such as kvm or docker?
– Jeff Schaller
Feb 7 at 0:26
username@DESKTOP-FOO:~$
is a command prompt .... it is not something that you type .... please try to clarify your post– jsotola
Feb 7 at 3:19
why do you want the command prompt to be
username@userPC:~$
?– jsotola
Feb 7 at 3:33
"DESKTOP-FOO" is the hostname of your computer. You can simply change it.
– RoVo
Feb 7 at 7:30