Command reference / ifs
DEL
Remove Link
The Remove link (DEL) command removes the link to the specified object. If this is the only hard link to the object, the object is removed when no longer in use. The object can be removed even if a symbolic link to it exists. The symbolic link remains until it is removed. This command is an alias for the Remove link (RMVLNK) command and can also be issued using the following alternative command names: ERASE, RMVLNK. For more information about integrated file system commands, see the Integrated file system topic collection in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/.
Allowed environments: *ALL.
Positional parameters: 1.
Restrictions
- In the "root" (/), QOpenSys, and user-defined file systems, the user must have write and execute (*WX) authority to the directory containing the object. If a hard link is to be unlinked, the user must also have object existence (*OBJEXIST) authority to the object.
- In the QDLS file system, the user must have all (*ALL) authority to the object and execute (*X) authority to the parent directory.
- The user must have *X authority to each directory in the path.
- See the IBM i Security Reference, SC41-5302 book for the authority requirements for other file systems.
- A user cannot unlink an object within a "root" (/), QOpenSys, or user-defined file system directory that has the "restricted rename and unlink" attribute set on (this attribute is equivalent to the S_ISVTX mode bit) unless one or more of the following are true: The user is the owner of the object. The user is the owner of the directory. The user has all object (*ALLOBJ) special authority.
- A directory cannot be unlinked.
- The link to a file cannot be removed if the file is a DataLink column in an SQL table and where a row in that SQL table references this file.
- The restrictions listed above are for the IBM i objects of the types *DDIR, *DSTMF, *SOCKET, *STMF, and *SYMLNK.
Parameters
OBJLNK
Object link
Specifies the path name of the object to unlink. Multiple links can be removed with a name pattern. The object path name can be either a simple name or a name that is qualified with the name of the directory in which the object is located. A pattern can be specified in the last part of the path name. An asterisk (*) matches any number of characters and a question mark (?) matches a single character. If the path name is qualified or contains a pattern, it must be enclosed in apostrophes. For more information on specifying path names, refer to "Object naming rules" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/. Note: This parameter is Unicode-enabled. See "Unicode support in CL" in the CL topic collection in the Programming category in the IBM i Information Center at http://www.ibm.com/systems/i/infocenter/ for additional information.
Examples
RMVLNK OBJLNK('PAY')
This command removes a link named PAY.
Generated from os/cl/catalog/DEL.json and os/cl/help/DEL.json.