Difference Between Cut and Delete

Share

What is the Difference Between Cut and Delete?

Cut and delete are both actions that you can perform on various applications, and, in most of them, they behave similarly. One exception is how cut and delete behave when you are cutting and deleting files in a file manager.

Typical Behavior

The delete operation deletes whatever is selected. It could be selected text in a text editor, a selected area of pixels in an image editor, or a random selected virtual object in other types of editors. What "deleting" means varies from application to application, but in general it means some piece of data is erased, and the bytes in memory it occupied will be freed so they can be used to store other data. Note that many editors support the ability to "undo" a deletion, so it's possible to un-erase something that has been erased by mistake.

The cut operation behaves very similar to the delete operation in most cases. Typically, the piece of data that is selected will be duplicated (copied) and the copy will be stored in what's called the "clipboard." What is this clipboard and how it works depends on the operating system. On Windows, the clipboard is a temporary storage area managed by the system, so even after we close an application, data copied (or cut) to the clipboard stays there because it doesn't need the application to stay running. On Linux, in some cases this isn't true, and if an application is closed the copied (or cut) data will be lost. After a copy of the data is placed in clipboard, the "cut" operation behaves exactly like the "delete" operation. It will delete the original data, because a copy already exist in the clipboard.

Behavior with Files

Cut and delete behave a bit differently when performed on files through a file manager.

First of all, in many cases "delete" doesn't actually delete a file. Deleting sends the file to the trash bin or recycle bin. This is a special area on Windows and other operating systems where files that the user deletes are kept temporarily so they have the ability to undo the deletion in case they were deleted by accident. In other words, deleting just moves the file from its original place to another, and doesn't actually do anything with its data.

If you delete a file from the trash bin, it's considered "permanently" deleted. You can also do this by skipping the trash bin using a keyboard shortcut like Shift+Delete. If your operating system doesn't support trash bins for some reason, it will also be "permanently" deleted instead of sent to the trash bin.

A "permanently" deleted file isn't actually "permanently" erased. The data of your files are stored in sectors of a mass storage device like a hard disk or an SSD. Your filesystem keeps track of which sectors belong to which files so it doesn't accidentally create a file in a sector that's already being used. If it did that, the file's contents would be partially overwritten, which would probably make the file unusable. When a file is "permanently" erased, what happens is that the filesystem "frees" the file's sectors so it can be used by other new files. It doesn't actually do anything with the file's data in bytes.

More specifically, the bits of the file aren't reset to 00000000 when you delete it or anything like that, which means we also have software that is capable of recovering even a "permanently deleted" file. If you ever need to recover a permanently deleted file, the first thing you should do is turn off your computer. While your computer is running, the system will keep creating very small files for all sorts of internal things, and there is chance those files will overwrite your "permanently" deleted file's bits. If that happens, you won't be able to recover it, so stopping the computer as soon as possible and calling an expert in data recovery is very important.

When a file is "cut" in a file manager, nothing actually happens. You heard that right. Nothing actually happens!

The file manager may display the file's icon with some effect to indicate that it has been cut, for example by making it semi-transparent. But the file hasn't been actually touched at all. It wasn't removed, or deleted, or anything like that. The file is in fact intact.

When you "cut" a file in a file manager, the file manager simply takes note of which file you cut. The file isn't even moved to the clipboard. That's because the clipboard is used to transfer data from one application to another application, and when you cut a file, the only thing you can do with it is paste the file in the file manager again, in the same application.

When cut a file from one place and paste it in another, what the file manager actually does is just move the file from one folder to another. It never deletes file.

Normally, "moving" data means deleting data, because we would be talking about moving data from one byte address to a different byte address. However, in the case of files, the file's contents are bytes in a mass storage device like a HDD or SSD, and the position (the byte address) of those bytes is managed by the filesystem. The filesystem keeps track of which files (which filenames, filepaths) are associated with which sectors of the storage devices..

When you move a file, you don't move the file's bytes from one place in the HDD to another. Instead, you simply change the record in the filesystem that says which folder the file belongs to. So if you move a file Cat.jpg from My Documents to My Pictures, the content of the file won't be moved, there is simply an internal record in the filesystem that said Cat.jpg was inside the My Documents folder, and it will be changed to say Cat.jpg is now inside the My Pictures folder.

If you have tried to move a very large file, such as video file of over one gigabyte, you may have noticed that moving the file, or cut and pasting it, moves the file very quickly, but if you tried to copy and paste it that would take much longer. That's because to copy and paste it's necessary to actually recreate all the bytes of the file, while cut and paste only changes the record that says which folder contains the file, and doesn't touch that gigabyte at all.

Written by Noel Santos.

About the Author

I'm a self-taught Brazilian programmer graduated in IT from a FATEC. In a world of increasingly complex and essential computers, I decided to use my technical expertise in hardware, desktop applications, and web technologies to create an informative resource to make PC's easier to understand.

View Comments