In: Computer Science
What is the advantage of ln command over cp command?
CP :
1. CP stands for COPY.
2. This command is used to copy file or group of files or directory.
3. It creates an exact image of a file on a disk with a different file name.
4. CP command requires at least two files names in its arguments.
types :-
i(interactive): i stands for interactive copying.
with this option first, the system warns the user before overwriting the destination file.
-b(Backup):
->Using this command it will create a backup of destination file in the same folder with the different names and in a different format
--f(force):
->if the system is unable to open a file to write the data, then this command will you to write the data forcefully by deleting the destination file and then copying the file from source to destination.
LN:
1. It is standard command utility used to create a hard link or symbolic link to an existing file.
2. The use of hard link allows multiple filenames to be associated with the same file since a hard link points to the inode of a given file, the data which is stored on disk.
3. ln command by default creates a hard link.
4. Most of the operating system prevent hard links to the directory from being created since such a capability could disrupt the file structure.