spacer graphic


Be Developers:
Put your banner here!

spacer graphic x10icon graphic [Bar]

Three Useful Command Line Shortcuts


This week a Tip for people who have come to love, or at least use, the BeOS command line tool, the Terminal application. More details about the command line can be found in Tip 10, The BeOS Command Line.

All of these items require you to edit your .profile file, a file that configures the BeOS shell, bash, whenever you launch a Terminal session. Instructions for doing this appear for the first item only. If you don't already have a .profile file, you can use the instructions in The BeOS Command Line to get started.

First, here's something fun! Let the BeOS give you some words of wisdom every time you start up the Terminal:

  1. Open your .profile file, by double-clicking it or by dragging it onto StyledEdit.

    Your .profile file is at /home/.profile.

  2. Add the following lines at the bottom of the document:

    # Show a fortune at startup

  3. Save the document.

  4. Quit StyledEdit, and quit Terminal if you have it running. Then launch Terminal from the Be menu, and...

    The fortune command in the Terminal

Now the BeOS will tell you something interesting every time you start a Terminal session. How's that for an incentive to use the command line!

Here are two more things you can add to your .profile file. Copy and paste the text right out of this page, if you like!

Adding the following lines will make it easier to get the "long listing" format for a directory listing in the Terminal:

# Shortcut for long listings
# Note: there are no ones (numbers) in the next line!
alias ll="ls -l"

Adding the following lines will give you a way to clear the screen on the Terminal. This is particularly useful if you use the command line a lot (which, of course, now that you're a bash guru -- or ambitious to become one -- you'll be doing every day ;-):

# Create a clear command to clear the Terminal screen
alias clear="echo -n -e '\033[H\033[2J'"

Run, don't walk, and put these on your BeOS system today!

Copyright © 1999 by Be, Inc. All rights reserved. Legal information (includes icon usage info).
Comments, questions, or confessions about our site? Please write the Webmaster.