Feedback

type to search

Displaying "Hi!" when I login to terminal??

Asked by , Edited by Fernando C. Estrada [ Admin ]

Hey, I’d like a “Hi!” message shown when I start the terminal, or login in text mode… How can I do it?

TIA

NN comments
or Cancel

6 answers

1

amlj [ Editor ]

Hehe… Didn’t know others are also interested in doing this kind of things. I always do that myself!

You must edit .bashrc for that user, or if you want to do it for all users, edit /etc/bash.bashrc.

I use VIM to edit text, use whatever you want. I’ll explain it the VIM way here:

# aptitude install vim

vim [FILE] —> Either edit the file in user’s home, or edit the /etc/bash.bashrc.

Now, press ‘i’, and copy paste this: echo “Hi!”

After that, press ‘Esc’ and write: :wq

That’s it.

NN comments
paulcarroty
-

Vim is not installed in default. Use nano ;)

amlj
-
Yeah… VIM is not installed by default and also, Nano is easier to use. But I find VIM more powerful.

Anyway, Nano is also good, and also, much easier. :–)

Thanks for mentioning that.

harryxxx
-

Hey! I used Nano to edit it! So, thank you paul. And amlj, this worked really great! I edited /etc/bash.bashrc! Thank you!

or Cancel
5

hamid_rostami [ Editor ]

Also it is interesting that use from “cowsay” instead of echo
For example add this line in your ~/.bashrc file (whitout
quotes) :
“cowsay Hi!”

NN comments
amlj
-

Hey hamid… Cowsay was not installed on my machine and I didn’t even know about it. It’s really really great! Thanks.

hamid_rostami
-

yes, it is very funny! you can use another picture with -f option: “cowsay Hi -f gnu"
see other cow-files in /usr/share/cowsay/cows

amlj
-
It just returns:


< Hi -f gnu >


    \   ^__^
     \  (oo)\_______
        (__)\       )\/\
            ||----w |
            ||     ||
hamid_rostami
-

Oh sorry, add -f option before text: “cowsay -f gnu hello”

amlj
-
Oh dude! You rock! Thanks!

goacid
-

scripts connecting over ssh won’t like that the bashrc return some words, so if you use it prefer changing the /etc/motd file

or Cancel
0

amlj [ Editor ]

By the way… I found something more interesting than just “Hi!”. I knew about this for a long time, but I had never actually tried it in bashrc file.

Install ‘sl’, and you can use sl command in the .bashrc file or bash.bashrc.

It’ll show something like an animation!

or Cancel
0

kaliko [ Editor ]

For bash, I’d rather use  ~/.bash_login instead of system wide bash.bashrc file if you want personal messages to be customizable for each users.

NN comments
amlj
-

Me too… But on my Debian machine, there is no .bash_login.

But it doesn’t matter, if you want it to be customizable for each user, edit the ~/.bashrc file.

or Cancel
0

amlj [ Editor ]

By the way, cowsay will not work for root, as /usr/games/cowsay is not in the PATH variable. (At least for me it was like that)

Neither will sl.

So, if you want to use them, use the full path, like /usr/games/cowsay /usr/games/sl.

Good luck.

or Cancel

Your answer

You need to join Debian to complete this action, click here to do so.