1.0 Interprocess communication
A process is an active operating system entity which executes programs. Normally, a process, like a specialist, does one particular job (well). In real life, there are complex workflows and we, often, have multiple processes collaborating to accomplish certain objectives.… Read more
1.0 fork and exec system calls
The use case is to execute a program in Linux environment. To execute a program, a process needs to be created. So, some process, already in existence, has to create a process for the program to be executed.… Read more
Git commands for common source code management use cases are listed.
2.0 Install Git
On a Ubuntu Linux system, Git can be installed with the command,
$ sudo apt-get install git
3.0 Set Identity
Before using Git, the user's identity (name, email) has to be set
$ git config --global user.email "firstname.lastname@example.org"
$ git config --global user.name "Joe Bloggs"
4.0 Initialize git repository
The first job for putting a project under source code management is to create a repository.… Read more
The cut command cuts sections of each line of input files and writes it on its standard output. It is mostly used for taking out a few columns from the input files. The command syntax is,
… Read more
bash idioms are tiny scripts, mostly one-liners, that accomplish a lot and can be used as building blocks in bigger scripts.
1.0 Find most frequent words
Suppose we have a bunch of text files and we wish to find the most frequently used words in those files, we can do that with the command,
cat * | tr -sc '[:graph:]' '\n' | sort | uniq -c | sort -nr
First, we capture all input with cat and pipe it to the tr command.… Read more
The tr command is a filter which reads the standard input, translates or deletes characters and writes on its standard output. The tr command syntax is,
tr [OPTION]... SET1 [SET2]
tr transliterates characters from SET1 into corresponding characters of SET2 in input and writes resulting text on the standard output.… Read more
The comm command compares two sorted files and gives output in three columns. The first column has lines which are present only in the first file. The second column contains lines which are present only in the second file.… Read more
The uniq command is a filter for finding unique lines in input. It reads input, suppresses duplicates and prints unique lines in its output. Used with the -D option, we can do the inverse and print the duplicate lines only.… Read more
The sort command is for sorting lines in text files. For example, if we have a file names, we can sort it with the sort command,
$ cat names
$ sort names
The words in the input lines are fields, which are numbered 1 onwards.… Read more
awk is a filter which takes the input and gives output after matching desired patterns and doing processing linked to matched patterns. awk is well suited for processing voluminous raw text data and producing statistical reports from it.
awk is named after the first character of the names of its designers, Al Aho, Peter Weinberger and Brian Kernighan, who developed it for Unix systems in the 1970s.… Read more