The Largest And Most Popular World Wide Web Technology Platform

Wednesday, November 28, 2018

Command to find and delete all files with any extensions (extensions) on Windows and Linux


Yesterday a friend asked AnonyViet how to delete all files with the extension * .abcxyz? Does your computer appear to have a strange file extension? Of course, there is, but not delete by clicking from the file that we will use offline. If you happen to want to delete all files that have the same extension (extension) or Extension then we can use cmd on Windows or Terminal on Linux to perform a quick removal.
In case you encounter files with strange extensions, it can be caused by Virus or other software. Deleting files to consider is sure to not affect the operation of the operating system offline. Encourage you to back up before following the instructions below.

Command to delete all files with any extension on Windows

This will delete the file permanently, no longer in the Recycle Bin.
First you need to open cmd up (press Windows + R key , type cmd , Enter ).
Access the drive containing the files with the extension you want to delete. For example, you see drive D:contains many files with the extension .abcxyz, then type D:and Enter
cmd D
Continue typing find and delete files with extension:  (replace abcxyz with the tag you want to find and delete). Inside:del /s /f *.abcxyz
  • del: command to delete files in Windows
  • / s: find and delete in subfolders
  • / f: delete the file with the Red-Only property
  • *. All files have any name. For example, you just want to delete the file anonyviet.abcxyz, then replace the *. into anonyviet.
  • abcxyz: file extension to delete
The result will be listed which directory contains the file has the extension  and has been deleted:*.abcxyz
find and delete windows files

Command to delete all files with any extension on Linux

On Linux, AnonyViet also often encountered a problem generating junk files due to misuse of the Plugin. One of the disadvantages of using the wrong function of creating webp images, without deleting the original file, doubles the hard drive capacity. Therefore, we have to find solution is to delete all the files have the webp extension.
Similar to cmd on Windows, Linux has a command window named Terimal or you use Putty to SSH into the command:
find . -name '*.webp' -delete
Inside:
find: search command in linux
  • : represents the current directory. If you want to search from root then replace into sign /
  • -name: search by name, or extension.
  • '* .webp': find all files with any name and have the extension webp.
  • -delete: find delete then always.
Find and delete files on linux
With just one basic command line, you can quickly find and delete files with any extension in just a few seconds. Using the command is very harmful, you should find out more cmd or linux command to support your work offline.

No comments:

Post a Comment