FreeBSD  Release  11.0  Install  Guide



How to use the ee editor

There are many file editors that come installed as part of the basic FBSD install and there are other editors in the ports system which you can install. The ee editor comes installed in the FBSD base system and it's the easiest editor to use for the beginner, so I will be using this editor for all the examples in this Guide.

Perform the following

cd /root             # Change into directory

ls                   # List contents of directory

ee .cshrc            # Edit file

This edits the default startup script for the root account. Use the arrow keys to scroll up or down and sideways on the line. You can use the delete key or backspace key to delete data on the line. The enter key inserts a blank line. Any lines that have a # means the text to the right of the # are comments.

As you can see, the front of the file we are editing has comments. A good habit to get into is to add your own comments to the file about what you are changing and the date you did it. Mark my words this will save your butt later sometime when you want to know what changes you did to the file and when. So add a comment like this:

# Changed by yourname date changed set prompt and default editor

Scroll down using the arrow key until you find:

setenv EDITOR vi

Use the arrow keys to position the curser on the s of setenv.

Press the # key to comment out this line.

Use the arrow key to move the curser back to the # you just entered.

Press enter to insert a blank line.

On the blank line type in:

setenv EDITOR ee

You just set the ee editor as your default editor.

Now continue scrolling down until you see an IF statement followed by a line containing:

set prompt = "'hostname -s'# "

You are going to do the same thing here as you did for the setnev.

Comment out the old line,

insert a blank line,

type in the following new command,

set prompt = "# %/ >"

The changed parts of the file should look like this.

The bold lines are what you should have changed.

#setenv EDITOR vi

setenv EDITOR ee

setenv PAGER more


if ($?prompt) then

# An interactive shell -- set some stuff up

set prompt = "# %/ >"

#set prompt = "`hostname -s`# "


Press ESC key to exit.

A window pops up that has the curser on ‘leave editor’ option, press enter.

Another pop up window asks if you want to save changes, press enter to save.

You have just made your first FBSD configuration change.

To test your change, enter exit on the command line. When the system login prompt returns, log in as root again and your command line should look like this:

# /root >

No matter where in the directory tree you go, the command line will be prefixed with the directory path of your current directory location.


To make these settings the permanent global default for all users you add to your system later, make the same above changes to:

ee /usr/share/skel/dot.cshrc


User Login Announcement

When you login as ‘root’ you receive the system wide Login Announcement. The text for this message is contained in a file /etc/motd. The /etc directory is the location of all the FBSD startup configuration files.

So lets change the Login Announcement file motd.

cd /etc          # Change into directory

ls               # List contents of directory

ee motd          # Edit file

As you can see the text in the motd file is just instructions about how to change the contents of the motd file. I suggest you delete every thing in this file except the 'Welcome line'. But you can say anything you want.

Pressing the Ctrl key and the 'k' key on the keyboard at the same time will delete a whole line at a time. After saving your changes, enter exit on the command line to log out. Then log back in to see your new motd Welcome message.


Command Line History

Now that you have entered a few commands, I will introduce you to the command line history function. Your curser is the little white box and it's positioned on the blank command line, use the keyboard up arrow key and the last command you issued will be inserted on the command line. Each time you press the up arrow key the next previous command from the history list will be inserted on the command line. If you passed by the command you wanted, you can use the down arrow key to transverse the history list in reverse order. Hitting the enter keyboard key will execute the command on the command line.


Keyboard F1 – F8 Keys

Pressing the keyboard ALT key and one of the F1 through F8 keys will present you with another session login prompt. You can have up to 8 concurrent sessions all logged in as the same user. This is real handy when you want to copy some text from one file to an other file or when you are doing a kernel recompile and you still want to do something else on your system while the compile is running. You press ALT F2 and login as root and do whatever you want to do without effecting the status of your F1 session.



All the operating system logs are stored in the same location, /var/log.

Lets go look at the logs.

cd /var/log       # Change into directory

ls                # List contents of directory

ee messages       # Edit file

We are only interested in the messages file at this time.

This file holds all the console messages for user ‘root’ account. The operating system posts all of its error messages to user ‘root’ console screen if the ‘root’ user is logged in and a copy is posted to this messages file. No other user account will see any system messages.


Previous Page                                        Next Page         

This FreeBSD Install Guide is an public domain HOW-TO. This content may be reproduced, in any form or by any means, and used by all without permission in writing from the author.