5

how can i display a message when open terminal.

i want to display a Specified text right after open terminal any time.

hence before do anything,i want that text will shown.

i want to understand what file or files should change...

thank you

1
  • Not a duplicate, if you look for adding a message to starting a terminal this is the first hit you would never find those other questions with a regular google search +1 for the question Commented Oct 30, 2016 at 20:26

1 Answer 1

10

You can add it to your ~/.bashrc. That file is read each time a new interactive shell is launched so it will be displayed each time you launch a terminal, or log in to the console or simply run bash. For example, you could add these lines:

echo "Hi, how are 'ya?"
4
  • its work but not when i open a new session terminal. it just work when i login with superuser.
    – smse
    Commented Mar 2, 2015 at 11:51
  • @smse what exactly did you do?
    – terdon
    Commented Mar 2, 2015 at 11:54
  • after login with superuser, in .bashrc append this line : echo "Hi, how are 'ya?"
    – smse
    Commented Mar 2, 2015 at 11:56
  • @smse why did you log in as the super user? You should do this as your regular user. Otherwise, you are modifying root's .bashrc and not yours.
    – terdon
    Commented Mar 2, 2015 at 11:57

Not the answer you're looking for? Browse other questions tagged .