Linux Script Examples

It is defined as Linux Script as the simple programming code that contains commands or commands which are executed sequentially.

Related Articles

This tool is used to control the behavior of a specific program or to interact with the operating system, in this way we can structure the commands that you want to execute through the keyboard. This technique can be easily opened with two techniques, one from the text editor of the graphical environment or from the terminal with Vim.

10 Linux Script Examples

  1. Bin / bash.

This is the first line of the script.

Value = 4

While (0-1t $ value).

Echo “$ value”

Sleep $ value.

Value = expr $ value -1.


  1. Files = tar –tg tar file.

Tar –xf .tars file.

For in $ files; do.

Grep = grep “I’m looking for you” -m4.

Cat $ i.

  1. Echo send – / exit / temp.exp.
  2. Set timeout -1 temp.exp.
  3. Sleep .1 exp temp.
  4. Expect / * / temp. exp.
  5. The tasks that are repeated can be grouped by means of a script so that they can be executed.
  6. Commands are written separately with line breaks.
  7. A plain text editor is used.
  8. Always in the first line you must indicate which script should be used to be able to interpret the rest of the commands well.
  9. To be able to execute the scrpt, you must type the name of the file and that way the characters are interposed.
  10. Commands should always be phrases that you can easily remember.
  11. Repetitive names can be soup, meat, bread, garlic bread, today we will eat among others.

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button