How to Remove Files To delete a single file, use the rm or unlink command followed by the file name: unlink filename rm filename. Verify that the swap file is no longer available. Recover the disk space so that you can use it for something else. Edit the /etc/vfstab file and delete the entry for the swap file. Removing a Swap File From Use Become superuser. If we pass a wildcard to unlink, you will receive an extra operand error. The syntax is simple, invoke the command and pass a single filename as an argument to remove that file. It has no options other than –help and –version. The unlink command is used to remove a single file and will not accept multiple arguments. The result may be a file that has a name, but no data. This may happen when a file is incompletely downloaded via the Web or an FTP (file transfer protocol) client, or when an email attachment is not transmitted correctly. Zero-byte files can occur when file transfers do not complete successfully. The -delete action is not available on all find command implementations. The -type f option makes sure that we are working on a regular file and not on directories or other special files. To delete all zero byte files in the current directory and sub-directories, use the following find command syntax. How do I delete a zero byte file in Linux?
0 Comments
Leave a Reply. |