Method 1: Command-Line
Delete any file or folder (you have permissions for) with the rm command
Open a Terminal [Ctrl]+[Alt]+[T] and type:rm example
Delete multiple filesrm example1 example2
Use the * to delete all files with the same extension (like.txt)rm /folder/*.txt
Delete a folder (directory) by adding -drm -d folder
Recursively delete a folder and everything inside by using -rrm -r folder
Method 2: GUI
The Trash (or Wastebasket) should be visible in the File Manager.
Drag an item to the trash (or Wastebasket) to throw it away
The icon changes here as well, to give you a visual reminder there is something in the Trash (or Wastebasket)
You may right-click individual files, several files, or all the files inside the Trash (or Wastebasket) and choose Delete
Or you may simply right-click the Trash (or Wastebasket) and choose Empty
You’ll need to confirm this is what you want to do
You may also right-click any file or folder you have permissions for and choose Move to Trash (or Wastebasket)
On the Desktop, you’ll also have the option to choose to Delete a file (after confirmation) with a right-click
If you’d like that Delete function to be available to you elsewhere; from within Thunar, go to Edit > Preferences…
Click the Behavior (or Behaviour) tab
And at the bottom, under Context Menu, check the check box for Show action to permanently delete files and folders
The Trash (or Wastebasket) is not on the Desktop by default but you may easily change that
Simply right-click an empty spot on the Desktop and choose Desktop Settings…
Then, click the Icons tab
And click the check box to show the Trash (or Wastebasket) on the Desktop
Right-click the Trash (or Wastebasket) and choose Empty Trash to permanently delete the items inside
You may also skip the Trash (or Wastebasket) altogether by selecting the item(s) you’d like to remove, pressing and holding down the [Shift] key on the keyboard and tapping the [Delete] key. You’ll still need to confirm this is what you want to do by clicking the [Delete] button or pressing [Enter] key on the keyboard.
Deleting a file any of the ways above doesn’t actually remove it from your computer – it just removes the reference to the file – which is why it’s possible to recover files you may have accidentally deleted. It’s like removing a launcher (or shortcut). The file itself is still there, at least until it’s overwritten.
Secure Deletion purposely overwrites the file, usually several times, to make it much harder if not impossible to recover. There are many methods to accomplish this but the two below use software already on your C4C Ubuntu system.
Securely Delete with dd
Securely delete a single file – provided you know the file size in bytes.
To find that out, open a Terminal [Ctrl]+[Alt]+[T] and type:ls -l path/to/filename | awk '{print $5}'
Zero-out the data with:dd status=progress bs=filesize-in-bytes count=1 if /dev/zero of=path/to/filename
Or, randomize the data with:dd status=progress bs=filesize count=1 if /dev/urandom of=path/to/filename
And then delete the file with:rm path/to/filename
Zero-out an entire HDD drive (do NOT use on SSD drives) by booting from C4C Ubuntu on USB, SD Card or DVD and issuing the following command where X = the drive you want to zero-out:sudo dd if=/dev/zero of=/dev/sdX bs=1M
Securely Delete with shred
Securely delete a single file
To remove the file, display verbose information, replace the space with zeros with 3 deletion passes
Open a Terminal [Ctrl]+[Alt]+[T] and type:shred -uvz n 2 path/to/filename
To do the same thing on every file in a folder, use the * wildcard:shred -uvz n 2 path/to/folder/*.*
Shred an entire HDD drive (do NOT use on SSD drives) by booting from C4C Ubuntu on USB, SD Card or DVD and issuing the following command where X = the drive you want to zero-out:sudo shred -vn 1 /dev/sdX
More Information | Delete See How to Delete a File in Ubuntu on Linux Hint, How to Remove Files & Directories in Ubuntu Linux on Orangeable, 8 Simple Ways to Securely Delete Files in Linux at Make Tech Easier, and How to Securely Delete Files in Linux at groovyPost.com More Information | Recover In case you’ve deleted something by accident, there is some hope you’ll be able to get it back. See 15 Linux Data Recovery Tools, DataRecovery, How to Recover Deleted Files, PhotoRec, PhotoRec Tutorial, Recover Damaged Memory Card, SystemRescueCd and TestDisk