What is the difference between a symbolic link and a hard link

0 votes
Recently I was asked this during a job interview. I was honest and said I knew how a symbolic link behaves and how to create one, but do not understand the use of a hard link and how it differs from a symbolic one. Any help will be appreciated!!
Apr 13, 2022 in Linux Administration by Rahul
• 9,680 points
455 views

No answer to this question. Be the first to respond.

Your answer

Your name to display (optional):
Privacy: Your email address will only be used for sending these notifications.
0 votes

Underneath the file system, files are represented by inodes. A file in the file system is basically a link to an inode.

A hard link, then, just creates another file with a link to the same underlying inode.

When you delete a file, it removes one link to the underlying inode. The inode is only deleted when all links to the inode have been deleted.

A symbolic link is a link to another name in the file system.

Once a hard link has been made the link is to the inode. Deleting, renaming, or moving the original file will not affect the hard link as it links to the underlying inode. Any changes to the data on the inode are reflected in all files that refer to that inode.

answered Apr 14, 2022 by Aditya
• 7,680 points

edited Mar 5

Related Questions In Linux Administration

0 votes
1 answer

What is the difference between ctrl z and ctrl c in command line?

Hi@akhtar, Generally, these two commands are used to ...READ MORE

answered Feb 24, 2020 in Linux Administration by MD
• 95,460 points
48,095 views
0 votes
0 answers

What is the difference between ''find .'' and ''find /'' on linux command

I am solving overthewire bandit. I looked ...READ MORE

Apr 20, 2022 in Linux Administration by Edureka
• 13,690 points
506 views
0 votes
0 answers

What's the difference between .so, .la and .a library files?

I know an .so file is a kind of ...READ MORE

Apr 25, 2022 in Linux Administration by Edureka
• 13,690 points
842 views
0 votes
1 answer

What is the linux command to find Memory and CPU usage in percent for last 30 days?

Try the following: Cat proc/meminfo top top -i less /proc/memin ...READ MORE

answered Oct 14, 2020 in Linux Administration by Kim
2,752 views
0 votes
0 answers

What is a .pid file and what does it contain?

Can anyone shed more light on this, ...READ MORE

Apr 14, 2022 in Linux Administration by Rahul
• 9,680 points
852 views
0 votes
1 answer

What is the meaning of 'errno'?

you can retrieve a complete list of ...READ MORE

answered May 20, 2019 in Linux Administration by Shubham
• 13,490 points
1,068 views
0 votes
1 answer
0 votes
1 answer

Make a unix alias with python script

The scope of an alias command is the shell ...READ MORE

answered Sep 10, 2018 in Python by Priyaj
• 58,020 points
976 views
0 votes
1 answer

Make a unix alias with python script

The scope of an alias command is the shell ...READ MORE

answered Sep 20, 2018 in Python by Priyaj
• 58,020 points
5,925 views
0 votes
1 answer

How to run Unix shell script from Java code?

ProcessBuilder pb = new ProcessBuilder("myshellScript.sh", "myArg1", "myArg2"); ...READ MORE

answered Oct 26, 2018 in Java by Daisy
• 8,140 points
6,617 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP