Bash Command Basics


Bash is a utility to manage linux and unix boxes and it is very popular because of its simple, well documented and unique usage. There is alternatives to bash like csh,sh,ksh but bash has very high usage rate against others. I have recently work on bash with its manual and wanted to write something that I have learned from them. By the way bash is an acronym for “Bourne again shell”.

Bash reads input and go on sequential manner. is treated as comment line like this.

Here is what really bash make.

  1. Reads script from various sources like terminal, file etc.
  2. Than parses the string in the input and makes required expantions and than gets commands.
  3. Performs neccasary directions
  4. Executes commands and wait for completion of the commands for their status.

As you can see there is a lot of work to execute a command or script in bash. But all of them makes the commands run in a perfect manner.


Quoting is clearing special words and strings from the script and make them work correctly. A non-quoted backslash is escape character for bash. Using single quote preserves characters in the string even usage of backslash but with double quoting makes $  ‘  \ special. For example \t is a tab.

Simple Commands

Generally the line starts with commands and their arguments in bash and separated with blanks lile this. Here ls is the command and /home/ismailbaydan is the argument. There may be a lot of arguments.

LEARN MORE  Linux hosts.allow and hosts.deny To Control Network Access


Pipe is used to connect commands together. For example to echo the content of the text file and look for a string is like this. grep uses the output of the cat command.


Timing is used to count cpu usage or time for a command. Here we make some copying and count for cpu usage.

You may also like...

Leave a Reply

Your email address will not be published.

Enjoy this blog? Please spread the word :)