Appendix A: Using the BeOS Command Line Shell


Appendix A: Using the BeOS Command Line Shell

Although the BeOS has a graphical user interface, it also has a command line interface. The BeOS command line environment is very similar to that found in most Unix systems. You don't need to use the command line to access the BeOS, but it is available for users who prefer to work in that environment.

The BeOS command line shell is based on the GNU bash shell. The bash shell supports a powerful scripting language and offers excellent control of command line tools.

bash stands for the Bourne-Again Shell, a derivative of the original Borne shell. To learn about the features of this command and scripting environment, check some of the many books available on the subject. One of the most comprehensive is Learning the bash Shell, by Cameron Newham and Bill Rosenblatt, published by O'Reilly & Associates (also the technical publishers for the BeOS and of the Be Book for programming with the BeOS). O'Reilly & Associates is on the web at http://www.ora.com/.

Accompanying the bash shell are many common GNU tools, including awk, sed, grep, the RCS tools, vi, and others. There are over 200 shell utilities in all. In addition to the standard Unix utilities there are a number of BeOS-specific command line tools that aid in performing BeOS-specific tasks. If you examine the directory /boot/beos/bin/ you'll see all the available tools that come standard with the BeOS.

Experienced users should find the BeOS command line environment familiar. It supports all the features of a current command line environment: command line history and editing, filename completion, aliases, etc. In addition, almost all standard Unix utilities exist and run as expected.


Accessing the BeOS Command Line

The BeOS command line environment is accessed through the Terminal application (/boot/apps/Terminal). Terminal supplies the text interface and gives you access to the bash shell tools that are integrated with the BeOS. When you double-click on the Terminal application, a Terminal window opens:

The $ prompt tells you that the command line is ready to accept any typed command. You can open multiple Terminal windows at the same time, each one executing its own set of commands. To exit the command line shell, type exit, close the Terminal window, or quit the application. Closing the window terminates any command currently executing in that shell.


Examples of Common Commands

You can also see a listing of supported commands in the on-line documentation on your BeOS CD (/boot/beos/documentation/). As examples, here are a few common commands:

Command Does this
ls Returns a list of the files in the current directory (list) or in the directory named on the command line (optionally). Example: ls /bin
cd path Change directory. Changes the current directory to path. Note that cd.. moves up one directory from the current one. Example: cd /boot/beos/etc
application_name Typing the name of an application launches the application. If you type application_name &, the application opens in the background and the process ID of the application is returned. Example: Pulse
ftp server_domain_name Opens an Internet file transfer protocol session. You can find out more about this command in the chapter "Using Internet Services." Example: ftp ftp.be.com
telnet domain_name Opens a Telnet remote access session. To find out more about this command see the chapter "Using Internet Services." Example: telnet netcom.com
ps Returns a list of every team and thread currently running on the BeOS, including their state and team/thread ID numbers. Example: ps
kill process_ID Terminates the thread with the given thread ID or name. If the thread is the main thread for an application, all associated threads are also killed. This command can be both helpful and dangerous, so be careful if you use it. You should not kill any system or server thread. Example: kill some_thread_name


Advanced Shell Users

Advanced shell users looking for tools such as GNU Emacs or Perl should look on the Be web site (http://www.be.com/beware) for links to ports of those programs. Many long-time Unix programs have found their way onto the BeOS, and almost all of them have an entry in the BeWare web pages.






The Be User's Guide, in lovely HTML, for BeOS Release 3.

Copyright © 1998 Be, Inc. All rights reserved.

Last modified February 19, 1998.