LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 09-06-2007, 03:42 AM   #1
MattJUK
Member
 
Registered: Dec 2006
Location: UK
Distribution: Ubuntu 8.10
Posts: 80

Rep: Reputation: 15
Welcome message on terminal


How do I get a welcome message to show on my linux terminal everytime I load one?

I am using Gnome and Gnome terminal at the moment.
 
Old 09-06-2007, 03:46 AM   #2
pwc101
Senior Member
 
Registered: Oct 2005
Location: UK
Distribution: Slackware
Posts: 1,847

Rep: Reputation: 128Reputation: 128
edit /etc/motd with your message.
 
Old 09-06-2007, 03:48 AM   #3
MattJUK
Member
 
Registered: Dec 2006
Location: UK
Distribution: Ubuntu 8.10
Posts: 80

Original Poster
Rep: Reputation: 15
Thanks.. what is the best way to display random quotes or similar?

(Edit: The MOTD doesn't show when I open a terminal anyway?)
 
Old 09-06-2007, 03:53 AM   #4
ethics
Senior Member
 
Registered: Apr 2005
Location: London
Distribution: Arch - Latest
Posts: 1,522

Rep: Reputation: 45
I just made a script that echoes the text and then added it to my.bashrc (which is executed each time a terminal is opened) probably not the most graceful but it works.

As for a random quote, you can use fortune, the package on arch is fortune-mod not sure about Ubuntu, you could easily do a search. There are loads of options for it like maximum quote length, obscene or not, there are even packages for HHGTTG etc. quotes.
 
Old 09-06-2007, 05:11 AM   #5
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

Rep: Reputation: Disabled
You can install fortunes from the Games section of Synaptic. To get a fortune quote in the terminal, add this to ~/.bashrc (above the bit about the prompt):

Code:
if [ -x /usr/games/fortune ]; then
     /usr/games/fortune -s
fi
The -s option is for a short quote, use -a for any or all.

Last edited by brianL; 09-06-2007 at 05:12 AM.
 
Old 09-06-2007, 05:40 AM   #6
lugoteehalt
Senior Member
 
Registered: Sep 2003
Location: UK
Distribution: Debian
Posts: 1,215
Blog Entries: 2

Rep: Reputation: 49
Quote:
Originally Posted by MattJUK View Post
(Edit: The MOTD doesn't show when I open a terminal anyway?)
You're not using Debian Etch are you? This has the odd feature that /etc/motd is overwritten at reboot. To get something that persists across boots modify /etc/motd.tail.
 
Old 09-06-2007, 07:33 AM   #7
MattJUK
Member
 
Registered: Dec 2006
Location: UK
Distribution: Ubuntu 8.10
Posts: 80

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by lugoteehalt View Post
You're not using Debian Etch are you? This has the odd feature that /etc/motd is overwritten at reboot. To get something that persists across boots modify /etc/motd.tail.
i'm using Ubuntu 7.04
 
Old 09-06-2007, 07:36 AM   #8
MattJUK
Member
 
Registered: Dec 2006
Location: UK
Distribution: Ubuntu 8.10
Posts: 80

Original Poster
Rep: Reputation: 15
Quote:
Originally Posted by brianL View Post
You can install fortunes from the Games section of Synaptic. To get a fortune quote in the terminal, add this to ~/.bashrc (above the bit about the prompt):

Code:
if [ -x /usr/games/fortune ]; then
     /usr/games/fortune -s
fi
The -s option is for a short quote, use -a for any or all.
Thank you. Is there a way to customise this (e.g. diff font colour, etc?)
 
Old 09-06-2007, 10:17 AM   #9
brianL
LQ 5k Club
 
Registered: Jan 2006
Location: Oldham, Lancs, England
Distribution: Slackware & Slackware64 14.1
Posts: 7,453
Blog Entries: 55

Rep: Reputation: Disabled
Quote:
Originally Posted by MattJUK View Post
Is there a way to customise this (e.g. diff font colour, etc?)
I don't know. I found out how to get the quote from the sample .bashrc in the "Advanced Bash Scripting Guide", which can be downloaded from the Linux Documentation Project.

http://tldp.org/
 
Old 09-06-2007, 11:25 AM   #10
nflenz
Member
 
Registered: Feb 2006
Distribution: CRUX 2.4
Posts: 96

Rep: Reputation: 18
Quote:
Originally Posted by pwc101 View Post
edit /etc/motd with your message.
I'm pretty sure the motd only appears after logging in. Editing ~/.bashrc is probably the best way to do it.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I echo a message to a terminal on another IP address fdvj Linux - Newbie 5 05-13-2013 08:04 AM
Strange message showed up in gnome-terminal fakie_flip Linux - Security 1 05-21-2007 05:32 AM
error message starting terminal skeletonca Linux - Newbie 1 10-23-2006 05:29 AM
Return message to particular terminal console? lewkh Linux - Software 1 04-28-2005 05:01 PM
Displaying a message on terminal roland_andrey Linux - General 4 01-10-2005 04:53 PM


All times are GMT -5. The time now is 02:15 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration