Unix

vi not showing color syntax highlighting in Ubuntu Linux

1.0 Error The vi editor in Ubuntu Linux distribution is not showing color syntax highlighting in the edit window. 2.0 Solution vi is one of the original text editors of the UNIX operating system offering full screen text editing with excellent cursor movement, navigation, search, edit, copy, cut and paste capabilities. The equivalent program under …

vi not showing color syntax highlighting in Ubuntu Linux Read More »

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 an inter process communication (IPC) mechanism in Linux and other UNIX-like systems. Based on input parameters, the kernel provides a (shared) memory segment to the calling process. The calling process maps the shared memory segment to its address space. This way, the same shared memory segment can be mapped …

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’ [input-file] … 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 »