A symbolic link is more like a shortcut or alias — it’s a special file that points to the path of another file or directory.
cd /data (enter)
Go back to the root (/).
Create a symbolic link called abc pointing to /data/xyz.txt ln -s /data/xyz.txt abc
this creates a symbolic link named abc in your current directory, pointing to /data/xyz.txt
A hard link is when a file has two (or more) names, and all of them are equal. Each name points to the same data on the disk. There is no “main” file or “copy”—they are all the same file from the filesystem’s point of view.
Now both file1 and file2 are hard links to the same file content. Editing file1 also changes file2, and vice versa. Deleting one does not remove the actual data unless all links are deleted.
ln is the command used to create hard links. Syntax: ln