Friday, November 21, 2014

ln command

Leave a Comment
using ln command to create symblock link and hard link in linux operating system.

Two concepts:

  • symbolic link a one file is a pointer or to another file. 
  • hard link two files share the same data and same inode .

how files are linked, how files are stored on a filesystem. A filesystem has three main:

superblock is contains information about the filesystem in general such as the number of inodes and data blocks.
inode table consists of several inodes and more important store information such as: the file
size, permissions etc.
Data block is data that make up the contents of the file.

The structure:

ln command
Hard link

ln command 02
symbolic link

To create hard link use ln command:

# ln existing-file target-file

To create symbolic link use ln command with -s option:

# ln -s link-to-file  file
Examples ln command:

# ln file1 file2
# ln -s file3 file4
Copyright by:


Post a Comment