file

Using Git

1.0 Introduction

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
Read more

Bash idioms

In a nutshell

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

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 (GTK_BOX (hbox), w -entry, TRUE, TRUE, 0);
    gtk_box_pack_start (GTK_BOX (hbox), find, FALSE, TRUE, 0);
    gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 0);

2.0

Read more
bash

Bash Tutorial

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.… Read more

umask in Linux

File Permissions

In Linux, each files has nine permission bits. There are three basic permissions, read (r), write (w) and execute (x), for a file. These three permissions are there for the owner (o) of the file, the group (g) set for the file and the "others" (o).… Read more

Modern design digital clock in Belgrade

cron

cron is a daemon that executes programs for users periodically at predefined times. The cron daemon or service is started by the init process during system initialization. cron comes from chronos, the Greek word for time. cron was authored by Brian Kernighan in Version 7 Unix.… Read more