如何使用 CMD 在 Windows 10 中尋找並刪除重複文件

WBOY
發布: 2024-08-02 10:07:03
原創
754 人瀏覽過

「嗨。我的筆記型電腦有時運行緩慢。啟動需要一分鐘,有時會在網頁上凍結。當我嘗試關閉頁面時,它不會立即關閉。我知道我有我遇到的問題是如何辨識並刪除正確的重複檔案/資料夾,有人可以幫我解決這個問題嗎? 如果您的 Windows 電腦上有多個重複的資料夾/檔案並且想要刪除這些重複項,使用命令可能是一個不錯的選擇。本文將向您展示如何使用 cmd 在 Windows 10 中尋找和刪除重複文件,以釋放並加快您的筆記型電腦/PC 的速度。

How to Find and Delete Duplicate Files in Windows 10 Using CMD

第 1 部分:在命令提示字元中使用 CMD 尋找並刪除重複檔案
  • 第 2 部分:在 Windows PowerShell 中使用 CMD 尋找並刪除重複檔案
  • 第 3 部分:尋找和刪除重複檔案的更簡單、更安全的方法
  • 1.在命令提示字元中使用 CMD 尋找並刪除重複檔案

有多種命令可以幫助您在 Windows 上尋找和刪除重複檔案。現在,讓我們看看其中一個。首先,按下

Win +Q

,然後在搜尋欄中輸入 cmd。接下來,右鍵單擊命令提示字元上的 並以管理員身份執行它。然後按照以下步驟操作。 如何使用cmd查找重複文件

步驟 1:在命令提示字元視窗中,輸入

cd /d 資料夾路徑

並按

Enter。  在輸入指令之前,找到要掃描重複檔案的資料夾並複製檔案路徑。然後將 資料夾路徑 替換為複製的檔案路徑。

第 3 步:輸入 How to Find and Delete Duplicate Files in Windows 10 Using CMDdir /s /b *.extension

並按

Enter。 然後你會發現命令視窗中列出了重複的檔案。在輸入命令之前,將 extension 替換為您要尋找的重複檔案的副檔名。

如何使用cmd刪除重複檔案How to Find and Delete Duplicate Files in Windows 10 Using CMD

值得注意的是,如果您使用 del 命令刪除重複的文件,這些文件將從您的磁碟中刪除,並且無法從回收站中檢索。現在,請按照以下步驟操作。

步驟1:在命令列視窗中,使用cmd設定特定位置作為尋找重複檔案的步驟1。

第2步:輸入

del“* – Copy.png”

並按

Enter。 在輸入命令之前將-Copy.png更改為真實檔案後綴和副檔名。例如,如果要刪除後綴和副檔名為-1.txt的重複文件,則需要輸入del“* – 1.txt”

之後,您就可以成功刪除那些不需要的相同副檔名的重複檔案了。 How to Find and Delete Duplicate Files in Windows 10 Using CMD

2.在 PowerShell 中使用 CMD 尋找並刪除重複檔案

除了命令提示字元之外,Windows PowerShell 還允許您使用 cmd 自動尋找並刪除重複檔案。步驟來了。

步驟1:以滑鼠右鍵按一下「開始」功能表,然後選擇

Windows PowerShell(管理員)

以管理員身分執行Windows PowerShell。

第 2 步:彈出 PowerShell 視窗後,輸入 How to Find and Delete Duplicate Files in Windows 10 Using CMDset-location –path C:

並按下

Enter。 注意:在輸入指令之前,將
C:

替換為您要尋找重複檔案的磁碟機。

Step 3: To find duplicate files using cmd in Windows PowerShell, enter following command and press Enter.

ls "scan folder" -recurse | get-filehash | group -property hash | where { $_.count -gt 1 } | % { $_.group } | Out-File -FilePath "scan result location"

Note: Here scan folder need to be changed into specific folder and scan result location need to be changed into the path where you want to export the list of duplicate files.

How to Find and Delete Duplicate Files in Windows 10 Using CMD

As mentioned above, this command will create a list of duplicate files, and you can delete the duplicate files according to the file path displayed in the list.

How to Find and Delete Duplicate Files in Windows 10 Using CMD

Step 4: To automatically delete duplicate files using cmd, enter following command and press Enter.

ls "search folder" -recurse | get-filehash | group -property hash | where { $_.count -gt 1 } | % { $_.group | select -skip 1 } | del

Note: Please replace search folder with specific folder path.

How to Find and Delete Duplicate Files in Windows 10 Using CMD

3. Easier and Safer Way to Find and Delete Duplicate Files

Compared with using cmd to find and delete duplicate files on Windows, using a professional duplicate file finder seems much easier. Here you should definitely have a try on iSumsoft DupFile Refixer. iSumsoft DupFile Refixer is a useful and reliable untility designed to automatically detect and sort out all formats of duplicate files on Windows. Moreover, it can help you mass delete all duplicate files across different files/folders at a time.

Let’s install iSumsoft DupFile Refixer on Windows and learn about how to find and delete duplicate files without using cmd.

Download

Step 1: Launch this duplicate file finder after installing it and click Add icon to select scan folder/drive.

How to Find and Delete Duplicate Files in Windows 10 Using CMD

Step 2: After adding the desired drive/folder to scan directory, click Start scanning to automatically check for duplicate files.

How to Find and Delete Duplicate Files in Windows 10 Using CMD

Step 3: When the scanning is completed, iSumsoft DupFile Refixer will create a scan report showing all duplicate files with file name, extension, size and date. It is easy for you to delete all duplicate files in bulk by clicking the box for File Name. If you want to check more details about the duplicate file, just right-click it and choose Open file location.

How to Find and Delete Duplicate Files in Windows 10 Using CMD

Extra Tips

iSumsoft DupFile Refixer allows you to customize scan settings to filter scanning items by clicking Settings on the home page.

1. You can check the box for All Types to scan for all kinds of duplicate files including pictures, videos, audio, etc.

2. You are able to Enter minimum size and maximum size to scan for duplicate files in a specific size.

3. You are allowed to skip hidden files, system files, program files and files in recycle bin during scanning.

Once the settings is finished, click OK to save the settings.

How to Find and Delete Duplicate Files in Windows 10 Using CMD

The Bottom Line

Using Command is a good option to find and remove duplicate files on your Windows Computer. But if you are looking for an easier and safer way, it is recommended to use an effective and easy-to-use duplicate file finder like iSumsoft DupFile Refixer which can help you accurately find out and fast delete duplicate files on Windows.

以上是如何使用 CMD 在 Windows 10 中尋找並刪除重複文件的詳細內容。更多資訊請關注PHP中文網其他相關文章!

來源:isumsoft.com
本網站聲明
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn
熱門教學
更多>
最新下載
更多>
網站特效
網站源碼
網站素材
前端模板
關於我們 免責聲明 Sitemap
PHP中文網:公益線上PHP培訓,幫助PHP學習者快速成長!