惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

H
Help Net Security
T
ThreatConnect
SecWiki News
SecWiki News
F
Future of Privacy Forum
AWS News Blog
AWS News Blog
C
Cisco Blogs
A
Arctic Wolf
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
Scott Helme
Scott Helme
V
V2EX
博客园 - 叶小钗
阮一峰的网络日志
阮一峰的网络日志
K
Kaspersky official blog
G
Google Developers Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
P
Privacy International News Feed
C
Cyber Attacks, Cyber Crime and Cyber Security
N
News | PayPal Newsroom
Schneier on Security
Schneier on Security
NISL@THU
NISL@THU
Microsoft Azure Blog
Microsoft Azure Blog
量子位
The Hacker News
The Hacker News
Stack Overflow Blog
Stack Overflow Blog
Security Latest
Security Latest
M
Microsoft Research Blog - Microsoft Research
Google Online Security Blog
Google Online Security Blog
博客园_首页
C
CXSECURITY Database RSS Feed - CXSecurity.com
I
InfoQ
Google DeepMind News
Google DeepMind News
Y
Y Combinator Blog
The Cloudflare Blog
Microsoft Security Blog
Microsoft Security Blog
Martin Fowler
Martin Fowler
Cisco Talos Blog
Cisco Talos Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
T
Troy Hunt's Blog
F
Fox-IT International blog
S
Security @ Cisco Blogs
博客园 - 司徒正美
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
C
Comments on: Blog
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
L
LINUX DO - 最新话题
GbyAI
GbyAI
Project Zero
Project Zero
腾讯CDC
T
Tailwind CSS Blog

DEV Community

LangGraph 워크플로우 템플릿 (v38) Sustainable AI Starts with Efficient AI How to Detect GPU Waste in a Kubernetes Cluster The Privacy Bug in My First Chrome Extension (And How to Avoid It) Serverless Mental Models: What They Don't Tell You Before You Build Preventing GPT hallucination in automated content pipelines: how I structure Make.com flows with data injection Hmm, where were we? AI Visibility Tools, Math Proofs, and Stripped Guardrails Shape Developer Landscape How AI and Electronics Are Changing Healthcare Devices: The Future of Smart Healthcare Author: Shivam Wakade | Founder, PrivSR Making Claude Sound Like Optimus Prime Understanding Reinforcement Learning with Human Feedback Part 5: Training the Reward Model with Loss Functions Learning Progress Pt.20 How Secure LoRa Communication Devices Work: Building the Future of Private and Long-Range Connectivity Author: Shivam Wakade | Founder, PrivSR How I Rebuilt an RPG Map Editor with Rust, React, and WASM Building a System That Automates YouTube Post-Production Building a 100% Serverless Digital Asset Packager in the Browser Game Recommended AI What is Human-In-The-Loop (HITL)? Deep Dive: React Server Components in TanStack Start Migrating off Google Analytics: Umami vs Plausible vs Fathom Building a Portfolio That Actually Demonstrates Software Engineering Async/Await in JavaScript: From Callbacks to Clean Code (2026) Benchmarking LLM Structured Outputs Angular 21 Multiselect Dropdown: A Migration-Friendly Component with Live Functional Tests ShareBox v5 — GPU transcoding, Netflix-style grid, and why I don't need Plex anymore TOML Schema is live Handling Duplicate Shopify Webhook Events (And Why You Must) Original Kubernetes Dashboard — retired upstream, upgraded to Angular 21. لماذا أسست ترينافو للتجار العرب الذين تتجاهلهم المنصات الغربية Construyendo un recomendador de películas en Python: de los datos al modelo When APIs Lie: A Lesson in Defensive Debugging Pope Leo XIV's AI Encyclical: What Builders Must Know (2026) Donna v0.3.0 HTB — MonitorsFour | Writeup The Free Tool You Trust Is the One You Should Fear the Most HTB — MonitorsFour | Writeup Fr 97. Embeddings and Vector Search: Semantic Search That Works Deep Dive: Building "Gravity Paint" - A Tactile Physics Instrument with React, Matter.js, and p5.js ABAP Unit Testing with Test Doubles and Mocking Frameworks: A Senior Architects Guide to Isolating Dependencies in SAP S/4HANA LeetCode Solution: 5. Longest Palindromic Substring kovax-react 0.8: Tailwind v4 preset, FormField adapters, ColorModeScript, and Storybook I built an AI résumé tool that refuses to lie about your experience The hat Azure Entra ID User & Role Management — Step-by-Step Practical Guide With A Simple Excercise The AI-Native Company: How a Single Founder Can Build Global Organizations Powered by AWS and an Ecosystem of Artificial Intelligences Building a Lightweight Remote MCP Knowledge Base on Cloudflare Workers Why I built Trinavo for the MENA merchants Western platforms ignore The N+1 Query That Killed Our Database, And How I Fixed It Docstrings vs Markdown Docs: What Should Developers Actually Write? Training Data Provenance: The Manifest Diff That Explains the Hash Add SVGIcons MCP to Claude Code and Find SVG Icons from Your Terminal 3 CLI Tools You Can Buy with Crypto — No KYC, No Subscriptions COSS Weekly: OpenClaw competitor NanoClaw Raises $12M, Dust Raises $40M, Sonar Acquires Gitar, and more How to know if you actually need mobile proxies (without buying any) Building Cursor for Community: A Buildathon Built on Time Pressure How we built a PII masking layer for LLM APIs — local detection, reversible tokens, one line to integrate Why MLFQ Was Way Ahead of Its Time Add Runtime Limits to Claude Agent Workflows I Built a Prompt Injection Detector with 98% Recall on Unseen Attacks. Here's Why Data Beat Architecture. 8 Vite Config Options Every Developer Should Know (Vite 8) Feature Flags That Forgot to Leave Why Trust Infrastructure Is Becoming the Hidden Layer of Donation Platforms XyPriss: Rethinking Core Performance and Zero-Trust Architecture in Modern Backends Designing Configuration for Scalable Treasure Hunts SSH Login Delays: The 10-Second Wait That Drives Us Crazy Building Production Multi-Agent Workflows in n8n: What 50 Deployments Taught Us A 3-layer memory system that gives Claude Code persistent context across sessions. Trishul SNMP Suite 2.0.1: Better MIBs, Traps, and SNMP Labs How I built a production AI SaaS as a solo developer Auto-labelling 1.2M robotics frames with VLMs: a failover story India’s Laws Were Not Built for AI — And Courts Are Filling the Gap skill-insp: A Skill That Scores Other Skills Clprolf Minimalist Messaging in the Age of AI What's actually in a good .cursorrules file? I built 10 of them — here's what I learned Building Strong Python Basics – Loops, Functions and Logic How to Choose the Right Tech Stack for Your Project I built a free multi-tab JSON editor — here's what I learned HTTP Headers Every Developer Should Know (2026) Building Cross-Platform Digital Products: Challenges and Best Practices Data Privacy in the Age of AI: How Product Teams Can Build Trust with Users What Would WordPress Look Like If It Were Designed Today? Why Backup Success Does Not Mean Database Recoverability Local AI Office Assistant That Never Sends Your Documents to the Cloud Building TaskForge: Translating Enterprise Chaos into an Open-Source Scheduler Tesla P40 in a Homelab: 24GB of Inference on a Budget Llama 4: Meta's Latest — Scout, Maverick, and the MoE Revolution George Hotz called AI code 'slop.' He's half right. Como Construir um Fluxo de Trabalho Baseado em Engenharia de Prompt e Automação We Audited Our Agent Tool-Call Traces. Half Our Eval Data Was Garbage. The Hidden Cost of Downtime: How SRE Error Budgets Protect National Economic Infrastructure Getting started with openHUMANS can be an exciting venture for developers looking to create innovative applications in the realm of human-ce Stack Overflow: A Powerful Community for Developers and Learners From Language Models to Humanoid Minds ✨ Road to Senior #2: How Computers Think in Numbers Why LLM debugging fails on fragmented repository context How to Deploy a LangGraph Agent on AWS Bedrock AgentCore An outreach kit for solo founders whose drafts can't hallucinate Open Satchel is live Amy Kwalwasser and the Growing Importance of Quantum Risk Modeling
Find Remove duplicated files in Google Drive
Phuong Tran · 2026-05-26 · via DEV Community

Phuong Tran (IT)

Để tìm và xóa các file trùng lặp trong thư mục Google Drive trên máy tính, bạn không nhất thiết phải cài đặt các ứng dụng phần mềm của bên thứ ba vào máy. Thay vào đó, bạn hoàn toàn có thể sử dụng các đoạn script (mã lệnh) chạy trực tiếp trên nền tảng đám mây của Google hoặc sử dụng Command Prompt/Terminal kết hợp với các công cụ mã nguồn mở.

Dưới đây là 3 cách phổ biến từ việc không cần cài gì cho đến dùng script/command line:


Cách 1: Sử dụng Google Apps Script (Không cần cài phần mềm, chạy trực tiếp trên trình duyệt)

Google cung cấp một môi trường lập trình trực tuyến gọi là Google Apps Script. Bạn có thể viết một đoạn mã ngắn để tự động quét toàn bộ Drive của mình, tìm các file trùng tên (hoặc trùng dung lượng) và đưa chúng vào danh sách để xóa hoặc tự động chuyển vào Thùng rác.

Cách thực hiện:

  1. Truy cập vào trang script.google.com.
  2. Nhấn vào Dự án mới (New Project).
  3. Xóa hết mã mặc định và dán đoạn mã script (JavaScript) sau vào để tìm các file trùng tên trong một thư mục cụ thể (hoặc toàn bộ Drive):
function findAndTrashDuplicates() {
  // Thay 'ID_THU_MUC_CUA_BAN' bằng ID thư mục trên link Google Drive của bạn
  // Ví dụ: https://drive.google.com/drive/folders/1A2B3C... -> ID là 1A2B3C...
  var folderId = 'ID_THU_MUC_CUA_BAN'; 
  var folder = DriveApp.getFolderById(folderId);
  var files = folder.getFiles();

  var fileMap = {};

  while (files.hasNext()) {
    var file = files.next();
    var name = file.getName();

    if (fileMap.hasOwnProperty(name)) {
      fileMap[name].push(file);
    } else {
      fileMap[name] = [file];
    }
  }

  for (var name in fileMap) {
    if (fileMap[name].length > 1) {
      // Sắp xếp để giữ lại file mới nhất hoặc cũ nhất tùy bạn
      // Ở đây ta giữ lại file đầu tiên tìm thấy, đưa các file trùng lặp còn lại vào Thùng rác
      for (var i = 1; i < fileMap[name].length; i++) {
        Logger.log('Đang xóa file trùng lập: ' + name);
        fileMap[name][i].setTrashed(true); // Di chuyển vào Trash
      }
    }
  }
  Logger.log('Hoàn thành quét file trùng!');
}

Enter fullscreen mode Exit fullscreen mode

  1. Nhấn nút Lưu (Save) (biểu tượng đĩa ảo) và nhấn Chạy (Run). Hệ thống sẽ yêu cầu bạn cấp quyền truy cập vào Drive của chính bạn để quét file.

Cách 2: Sử dụng Command Prompt / Terminal với công cụ Rclone (Dành cho người thích dùng dòng lệnh)

Nếu bạn đã cài đặt công cụ Google Drive cho máy tính (Google Drive for Desktop), các file của bạn sẽ xuất hiện như một ổ đĩa ảo (ví dụ ổ G:\). Tuy nhiên, việc quét file trùng trực tiếp bằng Command Prompt của Windows rất phức tạp và dễ nhầm lẫn.

Thay vào đó, dân công nghệ thường sử dụng một công cụ dòng lệnh mã nguồn mở cực mạnh tên là Rclone (không cần cài đặt cài cắm phức tạp, chỉ cần tải file .exe về chạy). Rclone có khả năng tương tác trực tiếp với API của Google Drive để tìm file trùng dựa trên mã băm MD5 (tức là trùng chính xác 100% nội dung, bất kể tên file có giống nhau hay không).

Cách thực hiện bằng Command Line:

  1. Tải Rclone về máy tính và cấu hình kết nối tới tài khoản Google Drive của bạn (qua lệnh rclone config).
  2. Mở Command Prompt (cmd) và chạy lệnh sau để tìm các file trùng lặp:
rclone dedupe google_drive:Thư_mục_của_bạn

Enter fullscreen mode Exit fullscreen mode

  1. Rclone sẽ quét và đưa ra các tùy chọn cho bạn trên Command Prompt:
  2. interactive: Hỏi bạn muốn giữ file nào cho từng trường hợp.
  3. first: Tự động giữ lại file đầu tiên tìm thấy và xóa các file sau.
  4. newest: Giữ lại file có thời gian chỉnh sửa mới nhất.
  5. oldest: Giữ lại file cũ nhất.

Cách 3: Sử dụng các Add-on/Ứng dụng chính thức trên Google Workspace Marketplace

Nếu việc chạy code hay gõ dòng lệnh quá phức tạp, bạn có thể sử dụng các tiện ích mở rộng được Google kiểm duyệt tích hợp thẳng vào tài khoản của bạn (không cần tải phần mềm về máy tính Windows/Mac).

Một trong những công cụ phổ biến và an toàn nhất là Filerev hoặc Organizer & Duplicate Remover for Google Drive™.

  • Bạn chỉ cần vào Google Workspace Marketplace, tìm tên các công cụ này rồi chọn cài đặt.
  • Các công cụ này chạy trực tiếp trên đám mây, tự động quét và phân loại các file trùng lặp chính xác 100% dựa trên byte dữ liệu, sau đó hiển thị danh sách cho bạn tick chọn xóa hàng loạt rất trực quan.

Tóm lại: Bạn không cần tải phần mềm bên thứ ba cài vào máy tính. Nếu bạn biết một chút về code, hãy dùng Cách 1 (Google Apps Script) để xử lý nhanh và hoàn toàn miễn phí; nếu muốn quét chuẩn xác bằng dòng lệnh theo nội dung file, hãy dùng Cách 2 (Rclone).

Để hiểu chi tiết hơn về cách thức hoạt động của các công cụ quét dọn tài khoản Drive tự động trên đám mây mà không cần cài phần mềm máy tính, bạn có thể tham khảo video hướng dẫn này.
Hướng dẫn tìm và xóa file trùng lặp trên Google Drive
Video này sẽ chỉ cho bạn từng bước cách sử dụng các công cụ dọn dẹp an toàn kết nối trực tiếp qua API của Google để quét và lọc bỏ các file trùng tên hoặc trùng nội dung một cách nhanh chóng.