What is Bash ?

Bash is a shell scripting program available on almost all Linux distributions. It is an acronym for Bourne Again Shell - since it is an enhanced replacement of sh, the original Unix shell program written by Steve Bourne.

Getting Started with Bash

Once you have logged into the Unix system using some sort of terminal emulator program (e.g. Putty), you will see the shell prompt. This means the shell is ready to accept input. The shell prompt usually includes the username@machinename, followed by the current working directory, and then the dollar sign.

e.g. [rbhatia@LinuxDesktop ~]$

This means that you have logged in to the machine LinuxDesktop with the username of rbhatia and your current working directory is the home directory (indicated by the tilde ~ sign)

Note: If the last character of the prompt is a hash mark (#) rather than a dollar sign, the terminal session has _superuser _privileges. This means that either we are logged in as the root user or we’ve selected a terminal emulator that provides superuser (administrative) privileges.

Command History

As in MS Dos, pressing the arrow keys allows you to scroll through previous commands. So pressing the up-arrow key allows you to see previous commands.

Note: Most Linux distributions remember the last 500 commands by default.

Copy / Pasting : To copy / paste in the shell environment you won't be able to use Ctrl + C, Ctrl + V. Instead you can simply select a block of text to Copy. And the right click should allow you to Paste the text in the target location.

Some simple commands

Now let's try to run some simple commands

date

Returns the current date

Fri Aug 18 14:30:28 EDT 2017

cal

Displays a calendar of the current month

August 2017

Su Mo Tu We Th Fr Sa

1 2 3 4 5

6 7 8 9 10 11 12

13 14 15 16 17 18 19

20 21 22 23 24 25 26

27 28 29 30 31

End the session

To end the session, you may either close the Terminal window or use the exitcommand to end the session.

results matching ""

    No results matching ""