file

Using sha256sum command for ensuring file integrity

1.0 SHA-2 A cryptographic hash function (CHF) is an algorithm to map arbitrary size data, called the message, to a fixed sized bit array, called the hash value, or message digest. It is a one way function. It is not feasible to generate the original message from the hash value. A small change in the …

Using sha256sum command for ensuring file integrity Read More »

File I/O in Linux

1.0 Input and Output (I/O) All programs need to interact with the external world which makes I/O important. Programs store data in files which provide large persistent storage. In this post we will look at the system calls and functions for file I/O and the issues that govern the program and I/O device interaction. 2.0 …

File I/O in Linux Read More »

Files in Linux

1.0 Files There are two basic concepts in Linux – processes and files. The processes do things and files keep all the important data. An efficient filesystem is important for an operating system. When Unix was conceived around 1969-70, several design decisions were taken to simplify the filesystem. It was thought that if something was …

Files in Linux Read More »

Analyzing the NGINX web server log file

1.0 Introduction Given an nginx web server log file, we might like to know who are the visitors to our website. One can go line by line through the log file, but that is tedious. It would be nice if we can get one line per client visiting the website, giving the IP address of …

Analyzing the NGINX web server log file Read More »

Using Git

1.0 Introduction Git commands for common source code management use cases are listed. 2.0 Install Git On an 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 “user1@example.com” $ …

Using Git 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 »

An Introduction to Shell in Linux

1.0 SHELL A shell provides a user interface to a computer system. There are two types of shells, the command line interface (CLI) and the graphical user interface (GUI). In this tutorial, we describe the command line interface shell only and refer to it simply as shell. A CLI shell is a programmable command interpreter …

An Introduction to Shell in Linux Read More »