ln Linux Commands

What is Linux ln Command?

Explanation

ln COMMAND:

ln command is used to create link to a file (or) directory. It helps to provide soft link for desired files. Inode will be different for source and destination.

SYNTAX :


ln [options] existingfile(or directory)name newfile(or directory)name

OPTIONS:


-f Link files without questioning the user, even if the mode of target forbids writing. This is the default if the standard input is not a terminal.
-n Does not overwrite existing files.
-s Used to create soft links.

EXAMPLE:


  1. ln -s file1.txt file2.txt

    Creates a symbolic link to 'file1.txt' with the name of 'file2.txt'. Here inode for 'file1.txt' and 'file2.txt' will be different.
  2. ln -s nimi nimi1

    Creates a symbolic link to 'nimi' with the name of 'nimi1'.

Ask Questions

Ask Question