bash shell

 

introduction

Bash is a powerful shell that provides a small set of internal functions, provides access to the programs stored on the system, and allows access to the filesystem itself.


For the most part there is little differentiation between the commands bash provides and additional programs installed on the computer. This causes a lot of confusion for people because they assume they are just issuing commands to the system, but they are really running programs written specifically to satisfy a certain need. Most of the commands you will use are actually small programs stored individually on the hard drive. See File System to find out more about where they are stored.

The Command Prompt

Below is a screenshot of what Terminal will look like when you open it for the first time. You are presented with some information about who you are, where you are, and where you’ve been.


Your background and text will likely be a different color, but you shouldn’t see much more than this when you open Terminal.app for the first time.


The “Last Login:” part its the last time you logged in or opened a shell.


ttys000” is the “device” that I logged in from. If you ever connect to your computer from a remote location this might have an IP address, but normally this will say “ttys” followed by a bunch of numbers. Don’t worry about it, it is fairly meaningless for our purposes here.


Under that is what is called the Command Prompt. This is where you will type in your commands, and when the command is finished you will be presented with another prompt. By default your prompt will include your computer’s name, your current directory and your current username. These are important things when logging into other systems, or when performing actions that require a specific user’s permissions.


From this point on we will be using #> to represent the command prompt. Also, as you might have noticed anything that should appear in the terminal or typed in will appear in a fixed width font like this. Commands to be typed on the terminal will appear as screenshots or as text in the following format:


#> stuff you should type

 

Continue on to learn your first terminal commands.