How To Delete A File In Ubuntu

Table of contents:

How To Delete A File In Ubuntu
How To Delete A File In Ubuntu

Video: How To Delete A File In Ubuntu

Video: How To Delete A File In Ubuntu
Video: How to delete Directories and Files in Ubuntu A Step By Step Tutorial 2024, April
Anonim

The way to delete files in operating systems of the GNU / Linux family, and Ubuntu in particular, differs from that used in Windows. To perform this operation, you can use the graphical interface, the command line, and the Midnight Commander file manager.

How to delete a file in ubuntu
How to delete a file in ubuntu

Instructions

Step 1

Make sure that the file really needs to be deleted and that you know its purpose. Please note that although most versions of Ubuntu have a Recycle Bin, files will not get into it with all deletion methods. There may also be no tools for recovering deleted files similar to Unerase in DOS. And without system files, the operability of the OS itself may be disrupted.

Step 2

To delete a file using the graphical interface, look on your desktop for an icon with a designation starting with hd for a hard drive or sd for a USB flash drive. For example, sda1 is for the first partition (a) of the first flash drive (1). Click on this icon once (no double click required). Find the file on the media that you want to delete. Right-click on it and select "Delete" from the context menu. Then, if a window with an additional question appears, confirm your choice by clicking on the "Yes" or "Ok" button (its name depends on which graphical interface is used: Gnome in Ubuntu, KDE in Kubuntu or XFCE in Xubuntu). You can also select several files with the mouse and then delete them at the same time.

Step 3

On the command line, use the rm (short for remove) command to remove the file. First go to the folder where the file is located: cd / folder / anotherfolder / yetanotherfolder / Then enter the command: rm filename.extension

Step 4

You can also delete a group of files by pattern. For example, to delete all files with txt extension, it looks like this: rm *.txt

Step 5

There is no Midnight Commander file manager in Ubuntu by default. So first download and install it: sudo apt-get install mc Then run the program: mc

Step 6

To delete a file, first navigate to the folder with it using the arrow keys and the Enter button. Then, moving the pointer (wide strip) to the desired file, press F8, then confirm your intention with the Enter key. To highlight a file, move the pointer to it and press Insert. The file name will turn yellow and the pointer will move down one line. With all the files you want highlighted, press F8 and you can delete them at the same time.

Recommended: