A soft link is an directory entry that points, by name, to another directory entry, which may or may not exist. Since it's pointing by name the target can even reside on a different mount point.
Hard links, on the other hand, are directory entries that point to an inode used by another directory entry, and is still valid if the original entry is removed. Since all access information but the name is saved with the inode, both entries will always have the same access rights, timestamps, and user/group information. Also, due to sharing the same inodes, a hard link can't cross the boundary between mount points.
The -f option (force) has a different description depending on your flavour of *NIX. In general it causes the link to be created regardless. At least one of the man pages indicates that it "removes existing destination files", so see the version of the man page for your system to know exactly what the option should do.
I've always thought of the link command in this manner:
rather than source and destination. So, if you have a file foo, and want to create a link l_foo, the command would be:
Whether or not you need the -f option depends on your system, whether or not you have write access to the existing file and maybe other factors.
A hard link is another directory reference to the exising file. It can be in the same directory as the first/other reference(s) or it can be in a different directory as long as that directory exists on the same physical filesystem. After you create the hard link to foo, executing ls -al foo will show that the link count (usually the value in column two of the output) has increased (probably 2).
I have a pen drive1 with UFS file system and it has 43G used. It has a hell lot of soft links to other files which are located in a second pen drive2. We partitioned the file system on sun sparc machine, such that / has around 150G space.Now when we are copying the files from pen drive 1 to / on... (3 Replies)
Hi
I want to create softlinks, my source files and folders are placed in one server(hostname: info-1) and i want to access those files from different host(hostname :info-2).
file and folder names in info-1 host.
file1
folder1
Thanks,
Mallik. (1 Reply)
Hi :-)
i have a dump of a backupdisk (~540GB / ext3). The Backups have some 100 millions of hardlinks (backups are created with storeBackup). The OS is linux.
A restore of a directory ended after some days with the errormessage "no memory to extend symbol table"
The restore of the complete... (0 Replies)
Hello,
I got an IHS 6.1 installed and want to publish a directory with an index of files, directories and symlinks / symbolic links / soft links, last ones being created with the usual Unix command "ln -s .... ....".
In httpd.conf I've tried following for that directory:
Options Indexes... (1 Reply)
Q1: Let's say I create a hard-link bar.c in /tmp to a file foo.c which resides in /var/tmp. Is there a easy way to find out which file /tmp/bar.c hardlinks to (and vice-versa - i.e which files have got hard-linked from /var/tmp/foo.c) when one does not (and wants to) know the location of the other... (0 Replies)
I am using command substitution into a find command in a script where I have built a menu to do a bunch of tasks within my unix account. When I choose the options for to find a file/files that have the same inode of the entered filename, ie hardlinks, nothing shows up. When I choose the appropiate... (2 Replies)