![]() ![]() Commands which read or write file contents will access the contents of the target file. The cp command has options that allow either the symbolic link or the target to be copied. Likewise, the mv command moves or renames the link, not the target. The rm (delete file) command removes the link itself, not the target file. Because the rename and unlink system calls are coded to operate directly on symbolic links, file system management commands (e.g., rm, mv) affect the symbolic link itself (instead of being applied to the symbolic link target, if any). However, the lstat, lchown and readlink operations are unique to symbolic links and do not apply to the target by using those system calls, programs that examine the file system (e.g., ls, find) can report on symbolic links (instead of their targets, if any). link_path is the path of the symbolic link.Īfter creating the symbolic link, some operations can be used to treat it as an alias for the target. Usually the target will exist, although symbolic links may be created to non-existent targets. Target_path is the relative or absolute path to which the symbolic link should point. The following command creates a symbolic link at the command-line interface (shell): Symlinks were introduced in 1982 in 4.1a BSD Unix from U.C. When the ln -s flag is specified, the symlink() system call is used instead, creating a symbolic link. The ln shell command normally uses the link system call, which creates a hard link. In POSIX-compliant operating systems, symbolic links are created with the symlink system call. This offers the opportunity to create a more intuitive or application-specific directory tree and to reorganize the system without having to redesign the core set of system functions and utilities. This is accomplished with several mechanisms, such as variant, context-dependent symbolic links. Some Unix as well as Linux distributions use symbolic links extensively in an effort to reorder the file system hierarchy. Programs that need to handle symbolic links specially (e.g., shells and backup utilities) thus need to identify and manipulate them directly. Some shells heuristically try to uphold the illusion of a tree-shaped hierarchy, but when they do, this causes them to produce different results from other programs that manipulate pathnames without such heuristic, relying on the operating system instead. Even the Unix standard for navigating to a directory's parent directory no longer works reliably in the face of symlinks. However, they have the effect of changing an otherwise hierarchic filesystem from a tree into a directed graph, which can have consequences for such simple operations as determining the current directory of a process. Symbolic links operate transparently for many operations: programs that read or write to files named by a symbolic link will behave as if operating directly on the target file. Hard links always refer to an existing file, whereas symbolic links may contain an arbitrary path that does not point to anything. Hard links do not link paths on different volumes or file systems, whereas symbolic links may point to any file or directory irrespective of the volumes on which the link and target reside. Symbolic links are different from hard links. Symbolic links pointing to moved or non-existing targets are sometimes called broken, orphaned, dead, or dangling. If a symbolic link points to a target, and sometime later that target is moved, renamed or deleted, the symbolic link is not automatically updated or deleted, but continues to exist and still points to the old target, now a non-existing location or file. If a symbolic link is deleted, its target remains unaffected. The symbolic link is a second file that exists independently of its target. This other file or directory is called the "target". By 1978 minicomputer operating systems from DEC, and in Data General's RDOS included symbolic links.Ī symbolic link contains a text string that is automatically interpreted and followed by the operating system as a path to another file or directory. CTSS on IBM 7090 had files linked by name in 1963. Limited support also exists in Windows 7 and Windows Vista, and to some degree in Windows 2000 and Windows XP in the form of shortcut files. Symbolic links are supported by POSIX and by most Unix-like operating systems, such as FreeBSD, Linux, and macOS. In computing, a symbolic link (also symlink or soft link) is a file whose purpose is to point to a file or directory (called the "target") by specifying a path thereto. For the Microsoft data exchange format, see Symbolic Link (SYLK). ![]()
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |