Unix

Syslog

1.0 Syslog Syslog is a protocol for conveying event notification messages. Syslog was first developed by Eric Allman for logging as a part of the Sendmail project in the 1980s. It soon became a de-facto standard for logging on Unix-like systems. Syslog was formally specified in RFC 3164 in 2001 as “The BSD syslog Protocol” …

Syslog Read More »

POSIX Shared Memory in Linux

1.0 Shared Memory Shared memory is the fastest method of interprocess communication (IPC) under Linux and other Unix-like systems. The system provides a shared memory segment which the calling process can map to its address space. After that, it behaves just like any other part of the process’s address space. 2.0 Why is shared memory …

POSIX Shared Memory in Linux Read More »

POSIX Semaphores in Linux

1.0 Semaphores Semaphores are used for process and thread synchronization. Semaphores are clubbed with message queues and shared memory under the Interprocess Communication (IPC) facilities in Unix-like systems such as Linux. There are two varieties of semaphores, the traditional System V semaphores and the newer POSIX semaphores. In this post we will look at the …

POSIX Semaphores in Linux Read More »

awk Tutorial

1.0 awk 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, …

awk Tutorial Read More »

sed command in Linux

1.0 sed sed is a stream editor that accepts a list of commands and input file names. It applies the commands one by one on each line of input and writes the resulting lines on the standard output. The commands are separated by newlines. 2.0 sed Command syntax sed [OPTIONS] ‘list-of-sed-commands’ filenames … sed is …

sed command in Linux Read More »

grep Command in Linux

1.0 grep grep is a program for searching a given string pattern in files. It searches the files for the pattern and prints the lines that contain strings matching the pattern. For example, $ # grep pattern filenames … $ grep ‘hbox’ find.c GtkWidget *window, *scrolled_win, *hbox, *vbox, *find; hbox = gtk_hbox_new (FALSE, 5); gtk_box_pack_start …

grep Command in Linux Read More »

Trigonometric calculations with bc

bc, the basic calculator under Linux and UNIX environments, provides commands for doing arbitrary precision mathematical calculations. The syntax for basic arithmetic functions is intuitive. Here, we look at the commands for doing trigonometric calculations. Scale The global scale variable gives the number of digits after the decimal point. By default, the value of scale …

Trigonometric calculations with bc Read More »

iostat

The iostat command is for getting the CPU and input-output devices' statistics for Linux and Unix systems. For example, $ iostat Linux 3.0.0-14-generic (hostname) Wednesday 06 June 2012 _i686_ (2 CPU) avg-cpu: %user %nice %system %iowait %steal %idle 17.38 0.13 3.13 1.63 0.00 77.74 Device: tps kB_read/s kB_wrtn/s kB_read kB_wrtn sda 11.78 111.65 69.79 11663838 …

iostat Read More »

top Command in Linux

The Unix top command is useful for monitoring systems continuously for processes that take more system resources like the CPU time and the memory. top periodically updates the display showing the high resource consuming processes at the top. top is an excellent aid in checking a system. If your Linux or Unix system is giving …

top Command in Linux Read More »