Unlink (Unix)
Encyclopedia
In Unix-like
operating systems, unlink is a system call
and a command line utility to delete files. The program directly interfaces the system call, which removes the file name and (but not on GNU
systems) directories like rm
and rmdir
. If the file name was the last hard link
to the file, the file itself is deleted as soon as no program has it open.
It also appears in the PHP
and Perl
programming languages in the form of the unlink built-in function. Like the Unix utility, it is also used to delete files.
Common use:
$ unlink ...
unlink($filename); (PHP)
Unix-like
A Unix-like operating system is one that behaves in a manner similar to a Unix system, while not necessarily conforming to or being certified to any version of the Single UNIX Specification....
operating systems, unlink is a system call
System call
In computing, a system call is how a program requests a service from an operating system's kernel. This may include hardware related services , creating and executing new processes, and communicating with integral kernel services...
and a command line utility to delete files. The program directly interfaces the system call, which removes the file name and (but not on GNU
GNU
GNU is a Unix-like computer operating system developed by the GNU project, ultimately aiming to be a "complete Unix-compatible software system"...
systems) directories like rm
Rm (Unix)
rm is a basic UNIX command used to remove objects such as files, directories, device nodes, symbolic links, and so on from the filesystem...
and rmdir
Rmdir
rmdir is a command which will remove an empty directory on a Unix, DOS, OS/2 or Microsoft Windows operating system. In Unix, Linux, and MacOS, it is case sensitive, whereas DOS, OS/2 and Windows , you can type the characters in any combination of upper case and lower case letters, and rd/rmdir...
. If the file name was the last hard link
Hard link
In computing, a hard link is a directory entry that associates a name with a file on a file system. . The term is used in file systems which allow multiple hard links to be created for the same file. This has the effect of creating multiple names for the same file, causing an aliasing effect: e.g...
to the file, the file itself is deleted as soon as no program has it open.
It also appears in the PHP
PHP
PHP is a general-purpose server-side scripting language originally designed for web development to produce dynamic web pages. For this purpose, PHP code is embedded into the HTML source document and interpreted by a web server with a PHP processor module, which generates the web page document...
and Perl
Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Perl was originally developed by Larry Wall in 1987 as a general-purpose Unix scripting language to make report processing easier. Since then, it has undergone many changes and revisions and become widely popular...
programming languages in the form of the unlink built-in function. Like the Unix utility, it is also used to delete files.
Common use:
$ unlink
unlink($filename); (PHP)
See also
- List of Unix programs
- link commandLink (Unix)The link utility is a Unix command line program that creates a hard link from an existing directory entry to a new directory entry. It does no more than call the link system function. It does not perform error checking before attempting to create the link. It returns an exit status that indicates...
- ln commandLn (Unix)ln is a standard Unix command used to create links to files.- Link files :Links allow more than one file name to refer to the same file, elsewhere.There are two types of links, both of which are created by ln:...