Easy Way to Choose and Delete Lot of Files Linux

In Linux, you can easily delete single files, groups of files, or entire folders. However, this works differently in Linux than in Windows. Keep reading to find out about different methods for removing files in Linux.

Contents

  1. Deleting files in Linux with a file manager
  2. Deleting files in Linux with the terminal
  3. A closer look at the "rm" command
    1. Deleting a single file
    2. Deleting multiple files
    3. Deleting files with a specific file name
    4. Deleting files of a certain file type
  4. Deleting all the files in a folder

Free VPS trial from IONOS

Test your vServer for free now - Try a virtual server for 30 days!

Dedicated resources

Unlimited traffic

Personal consultant

Deleting files in Linux with a file manager

Depending on the distribution and desktop environment you're using, you'll have Nautilus, Dolphin or another Linux file manager on your computer. Using these standard file managers, you can remove Linux files in just a few simple steps.

  1. Navigate in the file manager to the files that you want to delete.
  2. Hold down the left mouse button and select the files that you want to delete.

3. Right-click on one of the files to open the context menu. Depending on the distribution you're using, you'll find a menu item such as "Move to Trash" or "Delete File".

Tip

Instead of right-clicking, you can simply press [Del] to remove the selected files.

Deleting files in Linux with the terminal

Considering the large array of commands available in the terminal, it's no surprise that you can use the command line to delete files in Linux. To do so, complete the following steps:

  1. Open the file manager and navigate to the files that you want to delete. Alternatively, you can use the command "cd/path/to/the/file" to go directly to the files in the terminal.
  2. Right-click on the window to open the context menu, and then click on "Open in Terminal".

3. Use the command "rm" (short for "remove") to delete a single file or multiple files.

A closer look at the "rm" command

Depending on whether you want to delete a single file, multiple files, or all of the files of a certain file type, the "rm" command will look slightly different.

Deleting a single file

You can quickly and easily delete a single file with the command "rm" followed by the file name.

The command for deleting single files in the terminal
With the command "rm" followed by a file name, you can easily delete single files in Linux.

Deleting multiple files

To delete multiple files at once, simply list all of the file names after the "rm" command. File names should be separated by a space.

              rm DeleteMe.odt DeleteMe2.odt            
The command for deleting multiple files in the terminal
With the command "rm" followed by multiple file names, you can delete multiple files at once.

Deleting files with a specific file name

You can also remove all Linux files with a certain file name in the terminal.

The command for deleting all files with a certain file name
This command deletes all files that contain the name written between the asterisks.

Deleting files of a certain file type

If you have a folder that contains different file types and want to delete all the files of a certain type - for example, .pdf or .odt - simply enter the command "rm" followed by an asterisk and the file type.

In this case, you'll delete all files with the ending .odt.

Deleting all the files in a folder

If you want to delete all of the files and subfolders of a certain folder, enter the following command into the terminal:

In this case, all of the files in the folder "Files" will be deleted. The folder itself will remain. Of course it's also possible to delete a Linux directory, including all the files it contains.

hoeywifted.blogspot.com

Source: https://www.ionos.com/digitalguide/server/configuration/deleting-files-in-linux/

0 Response to "Easy Way to Choose and Delete Lot of Files Linux"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel