Linux small hints

things I have found usefull even life-saving when working with Linux

Blog Archives

Linux bash scripts – small fiddling with bac

By: admin |
January 11 2019 12:44

Bash is very powerful scripting language for quick development without big “hustle and bustle”. One of very powerful features are background processes. Here is small […]

Parallel run of tasks in bash script (1)

By: admin |
November 29 2016 12:58

Sooner or later you would face need to run several tasks in bash script in parallel and check exit codes. Plain parallel run is simple […]

source

By: admin |
April 4 2016 13:27

Bash build in command “source” or “.” executes commands from file passed as parameter: Commands are executed in current shell. To reload (changed) bash settings: […]

Operations with filenames, extensions, folders

By: admin |
March 15 2016 8:47

Get present timestamp / time zone etc.

By: admin |
November 6 2015 15:16

get present timestamp in seconds: date +”%Y.%m.%d %H:%M:%S” in nanoseconds: date +”%Y.%m.%d %H:%M:%S.%N” time zone in hours: date +%:z abbreviation of the time zone: date […]

CASE command

By: admin |
October 14 2015 13:36

Arithmetic operations in bash

By: admin |
October 14 2015 13:28

We can use two ways: variable=$((var1 + var2 + var3*2)) let variable=var1+var2+var3*2   Attantion! NO SPACES around “=” character.  if you write “variable = ….” […]

Bash built-in commands

By: admin |
October 14 2015 10:28

Some of these commands are well known so I do not describe them some other are described in separate posts:   ! = logicaly inverts […]

Arrays

By: admin |
October 14 2015 9:58

In bash we can use: indexed arrays – one dimensional array, index is number, starting from zero, no limit on the number of elements -> […]

Variable substitution

By: admin |
October 14 2015 8:32

variable=value -> sets “value” to “variable” ${variable} -> use value of “variable” – braces are optional if variable is separated from other following text but […]