Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the '10.5: Restore Terminal's welcome message' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.5: Restore Terminal's welcome message
Authored by: mountainbiker on Nov 02, '07 10:51:27AM
For those of you that hate vi, you could do
sudo cat "I love vi and Unix!" > /etc/motd
If you are going to be playing in terminal then you really want to set up your profile, e.g., .profile or .bash_profile.

Commenter #1 - use a lowercase w; that is, :w and :q --or-- simply :wq. vi commands are case-sensitive.

Thanks for the tip and info about alternative editors.

[ Reply to This | # ]
I believe you mean echo
Authored by: boredzo on Nov 02, '07 01:49:17PM

cat will read a file by that name (and fail). echo is the command you're looking for.



[ Reply to This | # ]
That was cat redirect
Authored by: MJCube on Nov 03, '07 04:23:06PM
No, mountainbiker is correct. Notice the > in that line. That takes the standard in and writes it to a file.

[ Reply to This | # ]
That was cat redirect
Authored by: OlKentuckyShark on Nov 04, '07 02:53:34AM

Nope. Give it a try. He definitely meant echo.

That command will attempt to open a file called "I love vi and Unix!" and dump its contents to /etc/motd.

And unless such a file exists, /etc/motd will just end up being blank.



[ Reply to This | # ]
Yepper ... echo (instead of cat)
Authored by: mountainbiker on Nov 04, '07 11:31:24PM
My bad -- use echo:

sudo echo "I love vi and Unix!" > /etc/motd

* and maybe more coffee ... assuming you have coffee on your file system -LOL ZZ

[ Reply to This | # ]
Or ZZ
Authored by: googoo on Nov 02, '07 07:19:28PM

Or you can save and quit from vi by pressing escape followed by ZZ (two upper-case Zs).

-Mark



[ Reply to This | # ]