November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

November 2024
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

RSYNC

What is rsync?

Rsync is a program for synchronizing two directory trees across different file systems even if they are on different computers. It can run its host to host communications over ssh to keep things secure and to provide key based authentication. If a file is already present in the target and is the […]

Soft Link and Hard Link in Linux

Linux provides the user’s to save the same data of a file with one or more different names in different places of a same partition in two ways :

Hard Link Symbolic Link Hard link is a directory entry which is associated with a file on a file system The term is used to represent […]

Singnals in Linux

Singnals in Linux Terminate or send a signal with kill or killall

# kill -s TERM 4712 ——– same as kill -15 4712 # killall -1 httpd ——– Kill HUP processes by exact name # pkill -9 http ——– Kill TERM processes by (part of) name # pkill -TERM -u www ——- Kill TERM processes […]

open files in linux

This is useful to find out which file is blocking a partition which has to be unmounted and gives a typical error of:

# umount /home/ umount: unmount of /home failed: Device busy

umount impossible because a file is locking home

Find opened files on a mount point with fuser or lsof:

# fuser […]

iostat / vmstat / mpstat

iostat / vmstat / mpstat are some tools to monitor server performance.

* iostat reports CPU, disk I/O, and NFS statistics.

* vmstat reports virtual memory statistics.

* mpstat reports processors statictics.

iostat

Iostat without any argument displays information about the CPU usage, and I/O statistics about all the partitions […]

tips in linux

mount -t iso9660 -o loop file.iso /mnt # Mount a CD image

# mount -t ext3 -o loop file.img /mnt # Mount an image with ext3 fs

# mount -o loop file.iso /mnt # extract an iso image to mnt

Remount a device without unmounting it. # mount -o remount,ro /

Copy the raw […]

How to Use MD5 Sum

Full Name : Message-Digest algorithm 5

Usage : Using an MD5 checksum you can verify the integrity of data

Algorithm : cryptographic hash function with a 128-bit value

MD5 sum first identify the the data which is backup and then create a MD5 checksum which is combination of unique string of letters and numbers put […]

Remove Blank lines from file

sed ‘/./!d’ filename.txt > temp1.txt

sed ‘/^$/d’ filename.txt > temp1.txt

grep -v ‘^$’ filename.txt > temp1.txt

Split the Large files

Split on a 300mb example.zip file:

#split -b 100mb example.zip

It will generate 3 files with the following file sizes:

100MB xaa 100MB xab 100MB xac

After split use: cat to combine a file

#cat xa* > example-new.zip

GNU tar (Tape ARchive)

GNU tar (Tape ARchive) saves multiple files together into a single tape or disk archive, and can restore individual files from the archive. Here are some Linux tar Command with Useful Practical Examples

Some useful command line switches are given below, which are used in this article.

c => create an archive file. v => […]