How do I add welcome message to Linux?
I want to add a welcome message (and change a greetings row) to Linux.
I added
echo "Hello"
PS1="u $: "
to “.profile” file, but nothing happens after the reboot. Why?
command-line sudo .profile
add a comment |
I want to add a welcome message (and change a greetings row) to Linux.
I added
echo "Hello"
PS1="u $: "
to “.profile” file, but nothing happens after the reboot. Why?
command-line sudo .profile
2
When should this be shown? On the GUI login screen? After logging in from the GUI? On the command line login? Again, before or after logging in? Or maybe when connecting throughssh
? Please edit your question and clarify what you are trying to do.
– terdon♦
Feb 23 '17 at 15:00
add a comment |
I want to add a welcome message (and change a greetings row) to Linux.
I added
echo "Hello"
PS1="u $: "
to “.profile” file, but nothing happens after the reboot. Why?
command-line sudo .profile
I want to add a welcome message (and change a greetings row) to Linux.
I added
echo "Hello"
PS1="u $: "
to “.profile” file, but nothing happens after the reboot. Why?
command-line sudo .profile
command-line sudo .profile
asked Feb 23 '17 at 14:49
KosararKosarar
1417
1417
2
When should this be shown? On the GUI login screen? After logging in from the GUI? On the command line login? Again, before or after logging in? Or maybe when connecting throughssh
? Please edit your question and clarify what you are trying to do.
– terdon♦
Feb 23 '17 at 15:00
add a comment |
2
When should this be shown? On the GUI login screen? After logging in from the GUI? On the command line login? Again, before or after logging in? Or maybe when connecting throughssh
? Please edit your question and clarify what you are trying to do.
– terdon♦
Feb 23 '17 at 15:00
2
2
When should this be shown? On the GUI login screen? After logging in from the GUI? On the command line login? Again, before or after logging in? Or maybe when connecting through
ssh
? Please edit your question and clarify what you are trying to do.– terdon♦
Feb 23 '17 at 15:00
When should this be shown? On the GUI login screen? After logging in from the GUI? On the command line login? Again, before or after logging in? Or maybe when connecting through
ssh
? Please edit your question and clarify what you are trying to do.– terdon♦
Feb 23 '17 at 15:00
add a comment |
3 Answers
3
active
oldest
votes
In order to make this work, you need to understand the order and when each config file for shell is being sourced( aka loaded). ~/.profile
is sourced at the time of logging in. It will be shown in TTY console perfectly fine - I personally have a message like that in my ~/.profile
for when I go into TTY specifically. If you call a shell again from that session, it won't be sourced. Same thing in GUI. You log-in , the file is sourced only once.
My guess is that you are trying to show the message in the GUI terminal. When you log in into desktop your ~/.profile
is already sourced, which also means it will not be sourced again in any terminal under that session, and message won't be shown. There's your problem.
The solution would be to place that message at the end of ~/.bashrc
. That file is sourced when each interactive session is open, regardless of whether you are logging-in or not.
I do not know what "sourced" means, but it works!
– Kosarar
Feb 23 '17 at 16:00
@user3107513 just means "loaded". Nothing more nothing less :)
– Sergiy Kolodyazhnyy
Feb 23 '17 at 16:01
add a comment |
If you want to get a custom message when you log in via ssh, you need to put a text file in /etc/update-motd.d
. Give it a name like 11-my-banner-message
and make the permissions -rwxr-xr-x.
The file can look like this
#!/bin/sh
#
#
printf "n"
printf " Howdy There!n"
add a comment |
You can do so by simply adding a few lines in the ~/.bashrc
file, which would make changes for only the current user for the default shell Bash. Check this out for the full explanation on showing custom-message/ASCII-art/random-one-liner as welcome to the linux terminal.
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "89"
};
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: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
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%2faskubuntu.com%2fquestions%2f886529%2fhow-do-i-add-welcome-message-to-linux%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
3 Answers
3
active
oldest
votes
3 Answers
3
active
oldest
votes
active
oldest
votes
active
oldest
votes
In order to make this work, you need to understand the order and when each config file for shell is being sourced( aka loaded). ~/.profile
is sourced at the time of logging in. It will be shown in TTY console perfectly fine - I personally have a message like that in my ~/.profile
for when I go into TTY specifically. If you call a shell again from that session, it won't be sourced. Same thing in GUI. You log-in , the file is sourced only once.
My guess is that you are trying to show the message in the GUI terminal. When you log in into desktop your ~/.profile
is already sourced, which also means it will not be sourced again in any terminal under that session, and message won't be shown. There's your problem.
The solution would be to place that message at the end of ~/.bashrc
. That file is sourced when each interactive session is open, regardless of whether you are logging-in or not.
I do not know what "sourced" means, but it works!
– Kosarar
Feb 23 '17 at 16:00
@user3107513 just means "loaded". Nothing more nothing less :)
– Sergiy Kolodyazhnyy
Feb 23 '17 at 16:01
add a comment |
In order to make this work, you need to understand the order and when each config file for shell is being sourced( aka loaded). ~/.profile
is sourced at the time of logging in. It will be shown in TTY console perfectly fine - I personally have a message like that in my ~/.profile
for when I go into TTY specifically. If you call a shell again from that session, it won't be sourced. Same thing in GUI. You log-in , the file is sourced only once.
My guess is that you are trying to show the message in the GUI terminal. When you log in into desktop your ~/.profile
is already sourced, which also means it will not be sourced again in any terminal under that session, and message won't be shown. There's your problem.
The solution would be to place that message at the end of ~/.bashrc
. That file is sourced when each interactive session is open, regardless of whether you are logging-in or not.
I do not know what "sourced" means, but it works!
– Kosarar
Feb 23 '17 at 16:00
@user3107513 just means "loaded". Nothing more nothing less :)
– Sergiy Kolodyazhnyy
Feb 23 '17 at 16:01
add a comment |
In order to make this work, you need to understand the order and when each config file for shell is being sourced( aka loaded). ~/.profile
is sourced at the time of logging in. It will be shown in TTY console perfectly fine - I personally have a message like that in my ~/.profile
for when I go into TTY specifically. If you call a shell again from that session, it won't be sourced. Same thing in GUI. You log-in , the file is sourced only once.
My guess is that you are trying to show the message in the GUI terminal. When you log in into desktop your ~/.profile
is already sourced, which also means it will not be sourced again in any terminal under that session, and message won't be shown. There's your problem.
The solution would be to place that message at the end of ~/.bashrc
. That file is sourced when each interactive session is open, regardless of whether you are logging-in or not.
In order to make this work, you need to understand the order and when each config file for shell is being sourced( aka loaded). ~/.profile
is sourced at the time of logging in. It will be shown in TTY console perfectly fine - I personally have a message like that in my ~/.profile
for when I go into TTY specifically. If you call a shell again from that session, it won't be sourced. Same thing in GUI. You log-in , the file is sourced only once.
My guess is that you are trying to show the message in the GUI terminal. When you log in into desktop your ~/.profile
is already sourced, which also means it will not be sourced again in any terminal under that session, and message won't be shown. There's your problem.
The solution would be to place that message at the end of ~/.bashrc
. That file is sourced when each interactive session is open, regardless of whether you are logging-in or not.
edited Feb 23 '17 at 15:47
answered Feb 23 '17 at 15:42
Sergiy KolodyazhnyySergiy Kolodyazhnyy
74k9154323
74k9154323
I do not know what "sourced" means, but it works!
– Kosarar
Feb 23 '17 at 16:00
@user3107513 just means "loaded". Nothing more nothing less :)
– Sergiy Kolodyazhnyy
Feb 23 '17 at 16:01
add a comment |
I do not know what "sourced" means, but it works!
– Kosarar
Feb 23 '17 at 16:00
@user3107513 just means "loaded". Nothing more nothing less :)
– Sergiy Kolodyazhnyy
Feb 23 '17 at 16:01
I do not know what "sourced" means, but it works!
– Kosarar
Feb 23 '17 at 16:00
I do not know what "sourced" means, but it works!
– Kosarar
Feb 23 '17 at 16:00
@user3107513 just means "loaded". Nothing more nothing less :)
– Sergiy Kolodyazhnyy
Feb 23 '17 at 16:01
@user3107513 just means "loaded". Nothing more nothing less :)
– Sergiy Kolodyazhnyy
Feb 23 '17 at 16:01
add a comment |
If you want to get a custom message when you log in via ssh, you need to put a text file in /etc/update-motd.d
. Give it a name like 11-my-banner-message
and make the permissions -rwxr-xr-x.
The file can look like this
#!/bin/sh
#
#
printf "n"
printf " Howdy There!n"
add a comment |
If you want to get a custom message when you log in via ssh, you need to put a text file in /etc/update-motd.d
. Give it a name like 11-my-banner-message
and make the permissions -rwxr-xr-x.
The file can look like this
#!/bin/sh
#
#
printf "n"
printf " Howdy There!n"
add a comment |
If you want to get a custom message when you log in via ssh, you need to put a text file in /etc/update-motd.d
. Give it a name like 11-my-banner-message
and make the permissions -rwxr-xr-x.
The file can look like this
#!/bin/sh
#
#
printf "n"
printf " Howdy There!n"
If you want to get a custom message when you log in via ssh, you need to put a text file in /etc/update-motd.d
. Give it a name like 11-my-banner-message
and make the permissions -rwxr-xr-x.
The file can look like this
#!/bin/sh
#
#
printf "n"
printf " Howdy There!n"
answered Feb 23 '17 at 16:18
Organic MarbleOrganic Marble
11.4k63459
11.4k63459
add a comment |
add a comment |
You can do so by simply adding a few lines in the ~/.bashrc
file, which would make changes for only the current user for the default shell Bash. Check this out for the full explanation on showing custom-message/ASCII-art/random-one-liner as welcome to the linux terminal.
add a comment |
You can do so by simply adding a few lines in the ~/.bashrc
file, which would make changes for only the current user for the default shell Bash. Check this out for the full explanation on showing custom-message/ASCII-art/random-one-liner as welcome to the linux terminal.
add a comment |
You can do so by simply adding a few lines in the ~/.bashrc
file, which would make changes for only the current user for the default shell Bash. Check this out for the full explanation on showing custom-message/ASCII-art/random-one-liner as welcome to the linux terminal.
You can do so by simply adding a few lines in the ~/.bashrc
file, which would make changes for only the current user for the default shell Bash. Check this out for the full explanation on showing custom-message/ASCII-art/random-one-liner as welcome to the linux terminal.
answered Feb 10 at 11:09
Devarshi Devarshi
1
1
add a comment |
add a comment |
Thanks for contributing an answer to Ask Ubuntu!
- 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%2faskubuntu.com%2fquestions%2f886529%2fhow-do-i-add-welcome-message-to-linux%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
2
When should this be shown? On the GUI login screen? After logging in from the GUI? On the command line login? Again, before or after logging in? Or maybe when connecting through
ssh
? Please edit your question and clarify what you are trying to do.– terdon♦
Feb 23 '17 at 15:00