{"id":33159,"date":"2021-02-19T12:03:07","date_gmt":"2021-02-19T12:03:07","guid":{"rendered":"https:\/\/www.cleverfiles.com\/howto\/?p=33159"},"modified":"2025-11-18T22:17:18","modified_gmt":"2025-11-18T22:17:18","slug":"how-to-recover-deleted-files-using-mac-terminal","status":"publish","type":"post","link":"https:\/\/www.cleverfiles.com\/howto\/recover-deleted-files-using-mac-terminal.html","title":{"rendered":"How to Recover Deleted Files Using Mac Terminal"},"content":{"rendered":"<p>So you&#8217;ve deleted a file on your Mac, and somewhere in your Googling, you stumbled upon mentions that it&#8217;s possible to recover permanently deleted files on Mac using Terminal. It&#8217;s true that Terminal can help restore deleted files, but only in some situations.<\/p>\r\n<p>We&#8217;ve tested every Terminal recovery method out there to find out what really works. In this guide, we&#8217;ll show you exactly what Terminal can and can&#8217;t do for file recovery, plus provide alternatives when Terminal isn&#8217;t enough.<\/p>\r\n<h2><span class=\"ez-toc-section\" id=\"what_is_mac_terminal_and_how_does_it_work\"><\/span>What Is Mac Terminal and How Does It Work?<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p><a href=\"https:\/\/en.wikipedia.org\/wiki\/Terminal_(macOS)\" target=\"_blank\" rel=\"noopener noreferrer\">Mac Terminal<\/a> is a command-line interface that provides direct access to macOS&#8217;s Unix-based system. It&#8217;s typically used by administrators, software developers, and power users to execute text-based commands that change system settings, compile software, manage files, and much more.<\/p>\r\n<p><img class=\"img-rounded border-gray border-radius-10 aligncenter wp-image-33162 size-full\" src=\"\/howto\/wp-content\/uploads\/2021\/01\/terminal-in-mac-os.jpg\" alt=\"Recover deleted files using macOS Terminal\" width=\"1012\" height=\"394\" srcset=\"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/terminal-in-mac-os.jpg 1012w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/terminal-in-mac-os-300x117.jpg 300w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/terminal-in-mac-os-500x195.jpg 500w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/terminal-in-mac-os-768x299.jpg 768w\" sizes=\"(max-width: 1012px) 100vw, 1012px\" \/><\/p>\r\n<p>&#x2705; <b>What Mac Terminal CAN do for data recovery:<\/b><\/p>\r\n<ul>\r\n\t<li>You can <a href=\"\/recover-deleted-files-mac.html\">recover deleted files on Mac<\/a> using Terminal if they&#8217;re still in the .Trash directory.<\/li>\r\n\t<li>Recover deleted folders on Mac by performing Terminal operations when the folders exist in Trash.<\/li>\r\n\t<li>Display hidden files and folders that might contain recoverable data.<\/li>\r\n\t<li>Access and restore files from local Time Machine backups.<\/li>\r\n<\/ul>\r\n<p>&#x26d4;&#xfe0f; <b>What Terminal CANNOT do for data recovery:<\/b><\/p>\r\n<ul>\r\n\t<li>It&#8217;s impossible to recover emptied trash on Mac using Terminal commands.<\/li>\r\n\t<li>Restore files that bypassed the Trash.<\/li>\r\n\t<li>Get back data that has been securely deleted or overwritten.<\/li>\r\n\t<li>Unformat a storage device after it has been formatted.<\/li>\r\n<\/ul>\r\n<p>In summary, Terminal is most useful for simple file recovery when items are still in the Trash. It&#8217;s not useful if the Trash has been emptied. Terminal in the context of recovery simply replaces (or rather duplicates) what you can do using the macOS UI.<\/p>\r\n<div class=\"alert alert-info\" role=\"alert\">In the following sections of this article, we&#8217;ll show you how to use Terminal to recover deleted files that haven&#8217;t been permanently removed. However, if you&#8217;ve already emptied the Trash or your files bypassed it entirely, don&#8217;t lose hope as you can <a href=\"#software\">jump directly to more effective data recovery methods<\/a>.<\/div>\r\n<h2 id=\"terminal-recovery\"><span class=\"ez-toc-section\" id=\"how_to_recover_deleted_files_using_mac_terminal\"><\/span>How to Recover Deleted Files Using Mac Terminal<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p>So if your files are still in the Trash, you can actually just open it and drag them out.<\/p>\r\n<p>But if you&#8217;re determined to use Terminal to recover deleted files on Mac (maybe there are some issues with Finder that make it impossible for you to access Trash the easy way), or you just want to learn how the command line works, here are the steps you can follow to <a href=\"\/howto\/recover-emptied-trash-mac.html\">recover emptied trash on Mac<\/a>:<\/p>\r\n<ol>\r\n\t<li>Open Terminal through your Utilities folder (Applications &gt; Utilities &gt; Terminal), and then type the following command and hit Return to navigate to the Trash folder: <kbd>cd .Trash<\/kbd><\/li>\r\n\t<li>Type this command to see everything in your Trash: <kbd>ls -al ~\/.Trash<\/kbd><\/li>\r\n\t<li>To recover a specific file, type: <kbd>mv filename ..\/<\/kbd> (replace &#8220;filename&#8221; with the exact name of your file (including the extension like .docx or .jpg, such as &#8220;my document.pdf&#8221;)<img class=\"img-rounded border-gray border-radius-10 aligncenter wp-image-33167 size-full\" src=\"\/howto\/wp-content\/uploads\/2021\/01\/move-file-from-trash-with-terminal.jpg\" alt=\"Mac recovery mode Terminal commands\" width=\"1541\" height=\"1121\" srcset=\"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/move-file-from-trash-with-terminal.jpg 1541w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/move-file-from-trash-with-terminal-300x218.jpg 300w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/move-file-from-trash-with-terminal-500x364.jpg 500w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/move-file-from-trash-with-terminal-768x559.jpg 768w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/move-file-from-trash-with-terminal-1536x1117.jpg 1536w\" sizes=\"(max-width: 1541px) 100vw, 1541px\" \/><\/li>\r\n\t<li>Close the Terminal window.<\/li>\r\n<\/ol>\r\n<p>Your recovered file should now appear in your home folder. It&#8217;s also possible to recover them to a different location. To do that, simply replace <kbd>..\/<\/kbd> in step 3 with your desired path, such as <kbd>~\/Desktop\/<\/kbd> for the Desktop or <kbd>~\/Documents\/<\/kbd> for the Documents folder.<\/p>\r\n<h2 id=\"software\"><span class=\"ez-toc-section\" id=\"what_to_do_when_mac_terminal_proves_ineffective\"><\/span>What to Do When Mac Terminal Proves Ineffective?<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p>When Terminal commands fail to recover your deleted files (happens whenever you&#8217;ve emptied the Trash or files bypassed it entirely), you need <a href=\"\/mac-data-recovery.html\">Mac data recovery software<\/a> that can dig deeper into your storage device.<\/p>\r\n<div class=\"alert alert-warning\" role=\"alert\">&#x26a0;&#xfe0f; <b>Important<\/b>: Stop using your Mac immediately if you need to recover deleted files. Every moment you continue using your drive risks overwriting the deleted data permanently.<\/div>\r\n<p>Data recovery software examines your disk at a much lower level than Terminal ever could by scanning for file signatures and analyzing available file system information. Disk Drill, ranked first among the <a href=\"\/howto\/top-5-data-recovery-software-mac.html\">best data recovery software for Mac<\/a>, offers free scanning that shows you precisely which files can be restored, complete with previews, so you know whether recovery is worth pursuing.<\/p>\r\n<p><b>Here&#8217;s how to recover deleted files on Mac with Disk Drill:<\/b><\/p>\r\n<ol>\r\n\t<li><a href=\"\/download.html\">Download<\/a> and install the latest version of Disk Drill. The installation process is straightforward as you just need to drag the app to your Applications folder.<img class=\"img-rounded border-gray border-radius-10 aligncenter wp-image-56341 size-full\" src=\"\/howto\/wp-content\/uploads\/2025\/10\/install-disk-drill-tahoe.jpg\" alt=\"Install Disk Drill Tahoe\" width=\"1798\" height=\"1118\" srcset=\"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/install-disk-drill-tahoe.jpg 1798w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/install-disk-drill-tahoe-300x187.jpg 300w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/install-disk-drill-tahoe-500x311.jpg 500w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/install-disk-drill-tahoe-768x478.jpg 768w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/install-disk-drill-tahoe-1536x955.jpg 1536w\" sizes=\"(max-width: 1798px) 100vw, 1798px\" \/><\/li>\r\n\t<li>Launch <b>Disk Drill<\/b> and grant it <b>Full Disk Access<\/b> when prompted. This permission allows the software to scan your entire drive, including system-protected areas where deleted files might be hiding.<\/li>\r\n\t<li>Select the drive or partition where your deleted files were stored. If you&#8217;re trying to recover deleted folder contents from your Mac&#8217;s internal drive, select your <b>Macintosh HD<\/b>.<img class=\"img-rounded border-gray border-radius-10 aligncenter wp-image-56342 size-full\" src=\"\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-search-for-lost-data-tahoe-external-hdd.jpg\" alt=\"Disk Drill Search For Lost Data Tahoe\" width=\"2940\" height=\"1598\" srcset=\"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-search-for-lost-data-tahoe-external-hdd.jpg 2940w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-search-for-lost-data-tahoe-external-hdd-300x163.jpg 300w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-search-for-lost-data-tahoe-external-hdd-500x272.jpg 500w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-search-for-lost-data-tahoe-external-hdd-768x417.jpg 768w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-search-for-lost-data-tahoe-external-hdd-1536x835.jpg 1536w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-search-for-lost-data-tahoe-external-hdd-2048x1113.jpg 2048w\" sizes=\"(max-width: 2940px) 100vw, 2940px\" \/><\/li>\r\n\t<li>Click <b>Search for lost data<\/b> to begin scanning. For external media a pop-up will appear. Choose to perform Universal Scan (<a href=\"\/help\/advanced-camera-recovery-in-disk-drill.html\">Advanced Camera Recovery mode<\/a> is intended for the recovery of fragmented videos from memory cards).<img class=\"img-rounded border-gray border-radius-10 aligncenter wp-image-56343 size-full\" src=\"\/howto\/wp-content\/uploads\/2025\/10\/universal-scan-disk-drill.jpg\" alt=\"Universal Scan in Disk Drill\" width=\"2872\" height=\"1590\" srcset=\"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/universal-scan-disk-drill.jpg 2872w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/universal-scan-disk-drill-300x166.jpg 300w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/universal-scan-disk-drill-500x277.jpg 500w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/universal-scan-disk-drill-768x425.jpg 768w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/universal-scan-disk-drill-1536x850.jpg 1536w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/universal-scan-disk-drill-2048x1134.jpg 2048w\" sizes=\"(max-width: 2872px) 100vw, 2872px\" \/><\/li>\r\n\t<li>Browse through the scan results using the file type filters on the left sidebar. You can search for specific files by name, filter by date, or preview files directly within Disk Drill to verify they&#8217;re intact.<img class=\"img-rounded border-gray border-radius-10 aligncenter wp-image-56344 size-full\" src=\"\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-tahoe-file-selection.jpg\" alt=\"Disk Drill Tahoe file selection\" width=\"2866\" height=\"1576\" srcset=\"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-tahoe-file-selection.jpg 2866w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-tahoe-file-selection-300x165.jpg 300w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-tahoe-file-selection-500x275.jpg 500w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-tahoe-file-selection-768x422.jpg 768w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-tahoe-file-selection-1536x845.jpg 1536w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-tahoe-file-selection-2048x1126.jpg 2048w\" sizes=\"(max-width: 2866px) 100vw, 2866px\" \/><\/li>\r\n\t<li>Select the files you want to recover by checking the boxes next to them. You can select individual files or entire folders or even all recoverable files.<\/li>\r\n\t<li>Click the <b>Recover<\/b> button and choose a safe recovery location. Never save recovered files back to the same drive they were deleted from as this could overwrite other recoverable data.<img class=\"img-rounded border-gray border-radius-10 aligncenter wp-image-56345 size-full\" src=\"\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-recovery-destination-tahoe-selection.jpg\" alt=\"Disk Drill recovery destination Tahoe\" width=\"2872\" height=\"1596\" srcset=\"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-recovery-destination-tahoe-selection.jpg 2872w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-recovery-destination-tahoe-selection-300x167.jpg 300w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-recovery-destination-tahoe-selection-500x278.jpg 500w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-recovery-destination-tahoe-selection-768x427.jpg 768w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-recovery-destination-tahoe-selection-1536x854.jpg 1536w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/disk-drill-recovery-destination-tahoe-selection-2048x1138.jpg 2048w\" sizes=\"(max-width: 2872px) 100vw, 2872px\" \/><\/li>\r\n<\/ol>\r\n<p>As you can see, the recovery process with Disk Drill is straightforward, but the results can vary greatly depending on your Mac.<\/p>\r\n<p>If your Mac uses an SSD (all modern Macs do), recovery becomes significantly more difficult <a href=\"https:\/\/community.handyrecovery.com\/d\/170-what-is-ssd-trim-and-why-does-it-make-data-recovery-harder\">due to TRIM technology<\/a>, which immediately erases storage blocks after file deletion to prepare them for use. That&#8217;s why it&#8217;s important to begin the recovery process as soon as you can. For detailed information about these challenges and specialized techniques, check out our guide on <a href=\"\/howto\/mac-ssd-data-recovery.html\">Mac SSD data recovery<\/a>.<\/p>\r\n<h2 id=\"other-methods\"><span class=\"ez-toc-section\" id=\"are_there_other_methods_besides_terminal_for_data_recovery\"><\/span>Are There Other Methods Besides Terminal for Data Recovery?<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p>We dug around and found a couple more methods you can use to recover deleted files on Mac besides Terminal commands. While the helpfulness of these approaches depends on various factors, this article wouldn&#8217;t be complete without covering them, especially since attempts to recover emptied trash on Mac using Terminal deliver good results only in a limited number of situations.<\/p>\r\n<h3 class=\"title_sc_bg\"><span class=\"ez-toc-section\" id=\"option_1_run_alternative_command_line_tools\"><\/span><span class=\"title_shortcode_bg\">Option 1:<\/span> <span id=\"cli-tools\">Run Alternative Command Line Tools<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>If you prefer CLI tools or are looking for free solutions, <a href=\"https:\/\/www.cgsecurity.org\/wiki\/PhotoRec\" target=\"_blank\" rel=\"noopener noreferrer\">PhotoRec<\/a> and <a href=\"https:\/\/www.cgsecurity.org\/wiki\/TestDisk\" target=\"_blank\" rel=\"noopener noreferrer\">TestDisk<\/a> form an excellent open-source bundle that can solve a number of your data recovery problems.<\/p>\r\n<h4 id=\"photorec\">PhotoRec (File Recovery Tool)<\/h4>\r\n<p>PhotoRec specializes in recovering deleted files directly from your storage device by detecting their signatures. Despite its name, it supports hundreds of file formats, so it can handle everything from documents to videos on accessible drives.<\/p>\r\n<p>The main limitations are that it can&#8217;t recover original file names and folder structures, which means you&#8217;ll need to sort through recovered files manually. Additionally, PhotoRec is unable to access system partitions on Macs with Apple Silicon (M1-M4) or T2 security chips due to their hardware encryption and security features (it can only work with external drives or secondary partitions on these systems).<\/p>\r\n<p><b>To install and use PhotoRec:<\/b><\/p>\r\n<ol>\r\n\t<li>Install Homebrew from Terminal if you haven&#8217;t already: <kbd>\/bin\/bash -c \"$(curl -fsSL https:\/\/raw.githubusercontent.com\/Homebrew\/install\/HEAD\/install.sh)\"<\/kbd><img class=\"img-rounded border-gray border-radius-10 aligncenter wp-image-56346 size-full\" src=\"\/howto\/wp-content\/uploads\/2025\/10\/install-homebrew-tahoe.jpg\" alt=\"Install Homebrew on Mac Tahoe\" width=\"1422\" height=\"968\" srcset=\"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/install-homebrew-tahoe.jpg 1422w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/install-homebrew-tahoe-300x204.jpg 300w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/install-homebrew-tahoe-500x340.jpg 500w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/install-homebrew-tahoe-768x523.jpg 768w\" sizes=\"(max-width: 1422px) 100vw, 1422px\" \/><\/li>\r\n\t<li>Install TestDisk (which includes PhotoRec): <kbd>brew install testdisk<\/kbd><\/li>\r\n\t<li>Launch PhotoRec: <kbd>sudo photorec<\/kbd><\/li>\r\n\t<li>Select your disk from the list using the arrow keys and press <kbd>Enter<\/kbd>.<img class=\"aligncenter size-full wp-image-56347\" src=\"\/howto\/wp-content\/uploads\/2025\/10\/photorec-select-disk.jpg\" alt=\"PhotoRec select disk\" width=\"1416\" height=\"958\" srcset=\"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/photorec-select-disk.jpg 1416w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/photorec-select-disk-300x203.jpg 300w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/photorec-select-disk-500x338.jpg 500w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/photorec-select-disk-768x520.jpg 768w\" sizes=\"(max-width: 1416px) 100vw, 1416px\" \/><\/li>\r\n\t<li>Choose the partition where your files were deleted.<\/li>\r\n\t<li>Select the file system type.<img class=\"img-rounded border-gray border-radius-10 aligncenter wp-image-56348 size-full\" src=\"\/howto\/wp-content\/uploads\/2025\/10\/photorec-file-system-select.jpg\" alt=\"PhotoRec file system select\" width=\"1414\" height=\"962\" srcset=\"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/photorec-file-system-select.jpg 1414w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/photorec-file-system-select-300x204.jpg 300w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/photorec-file-system-select-500x340.jpg 500w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/photorec-file-system-select-768x523.jpg 768w\" sizes=\"(max-width: 1414px) 100vw, 1414px\" \/><\/li>\r\n\t<li>Choose whether to scan only free space or the whole partition.<\/li>\r\n\t<li>Select a destination folder for recovered files (must be on a different drive).<img class=\"img-rounded border-gray border-radius-10 aligncenter wp-image-56349 size-full\" src=\"\/howto\/wp-content\/uploads\/2025\/10\/photorec-destination-select.jpg\" alt=\"PhotoRec destination selection\" width=\"1410\" height=\"968\" srcset=\"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/photorec-destination-select.jpg 1410w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/photorec-destination-select-300x206.jpg 300w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/photorec-destination-select-500x343.jpg 500w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/photorec-destination-select-768x527.jpg 768w\" sizes=\"(max-width: 1410px) 100vw, 1410px\" \/><\/li>\r\n\t<li>Wait for the scan to complete. PhotoRec will organize recovered files by type in the recovery destination folder.<\/li>\r\n<\/ol>\r\n<div class=\"alert alert-secondary\" role=\"alert\">&#x1f517; To learn more about PhotoRec&#8217;s capabilities and limitations, you can read our detailed <a href=\"\/howto\/photorec-review.html\">PhotoRec review<\/a>.<\/div>\r\n<h4 id=\"testdisk\">TestDisk (Partition Recovery Tool)<\/h4>\r\n<p>While PhotoRec handles individual files, TestDisk is best suited for scenarios where you&#8217;ve accidentally <a href=\"\/partition-recovery.html\">deleted an entire partition<\/a> or need to repair a damaged file system because it recovers file system information rather than individual files.<\/p>\r\n<p><b>How to use TestDisk for partition recovery:<\/b><\/p>\r\n<ol>\r\n\t<li>If you haven&#8217;t already installed it, follow steps 1-2 from <a href=\"#photorec\">PhotoRec above<\/a>.<\/li>\r\n\t<li>Launch TestDisk from Terminal: <kbd>sudo testdisk<\/kbd><\/li>\r\n\t<li>Select <b>Create<\/b> to generate a new log file.<img class=\"img-rounded border-gray border-radius-10 aligncenter wp-image-56350 size-full\" src=\"\/howto\/wp-content\/uploads\/2025\/10\/sudo-testdisk.jpg\" alt=\"Run TestDisk using sudo\" width=\"1424\" height=\"944\" srcset=\"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/sudo-testdisk.jpg 1424w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/sudo-testdisk-300x199.jpg 300w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/sudo-testdisk-500x331.jpg 500w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/sudo-testdisk-768x509.jpg 768w\" sizes=\"(max-width: 1424px) 100vw, 1424px\" \/><\/li>\r\n\t<li>Choose your affected drive from the list.<\/li>\r\n\t<li>Select the partition table type (usually <b>EFI GPT<\/b> for modern Macs).<\/li>\r\n\t<li>Select <b>Analyse<\/b> to search for lost partitions.<img class=\"img-rounded border-gray border-radius-10 aligncenter wp-image-56351 size-full\" src=\"\/howto\/wp-content\/uploads\/2025\/10\/testdisk-analyse.jpg\" alt=\"TestDisk analyse\" width=\"1402\" height=\"978\" srcset=\"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/testdisk-analyse.jpg 1402w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/testdisk-analyse-300x209.jpg 300w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/testdisk-analyse-500x349.jpg 500w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/testdisk-analyse-768x536.jpg 768w\" sizes=\"(max-width: 1402px) 100vw, 1402px\" \/><\/li>\r\n\t<li>Choose <b>Quick Search<\/b> to scan for deleted partitions.<img class=\"img-rounded border-gray border-radius-10 aligncenter wp-image-56352 size-full\" src=\"\/howto\/wp-content\/uploads\/2025\/10\/testdisk-results.jpg\" alt=\"TestDisk results\" width=\"1420\" height=\"978\" srcset=\"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/testdisk-results.jpg 1420w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/testdisk-results-300x207.jpg 300w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/testdisk-results-500x344.jpg 500w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2025\/10\/testdisk-results-768x529.jpg 768w\" sizes=\"(max-width: 1420px) 100vw, 1420px\" \/><\/li>\r\n\t<li>If Quick Search doesn&#8217;t find your partition, try <b>Deeper Search<\/b>.<\/li>\r\n\t<li>Once found, select your partition and choose <b>Write<\/b> to restore it.<\/li>\r\n<\/ol>\r\n<div class=\"alert alert-secondary\" role=\"alert\">&#x1f517; TestDisk can seem intimidating at first, but our <a href=\"\/howto\/testdisk-review.html\">TestDisk review<\/a> covers its capabilities in detail, so we encourage you to check it out.<\/div>\r\n<h3 class=\"title_sc_bg\"><span class=\"ez-toc-section\" id=\"option_2_utilize_time_machine_backups\"><\/span><span class=\"title_shortcode_bg\">Option 2:<\/span> <span id=\"time-machine\">Utilize Time Machine Backups<\/span><span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>Time Machine remains one of the most reliable ways to recover deleted files on Mac, and it&#8217;s especially effective for <a href=\"\/howto\/recover-overwritten-file-mac.html\">recovering overwritten files on Mac<\/a> (something that neither Terminal commands nor recovery tools can accomplish). However, it can only help if it was already enabled before you lost your files.<\/p>\r\n<p><b>Follow these steps to restore from Time Machine:<\/b><\/p>\r\n<ol>\r\n\t<li>Connect your Time Machine backup drive to your Mac if you have access to it. If not, continue regardless because recovery may still be possible from local snapshots (more about them below).<\/li>\r\n\t<li>Open the folder where your deleted files were originally stored.<\/li>\r\n\t<li>Click the <b>Time Machine<\/b> icon in your menu bar and select <b>Enter Time Machine<\/b>.<\/li>\r\n\t<li>Use the timeline on the right side to navigate to a date before the files were deleted.<img class=\"img-rounded border-gray border-radius-10 aligncenter wp-image-33171 size-full\" src=\"\/howto\/wp-content\/uploads\/2021\/01\/recover-deleted-files-via-time-machine.jpg\" alt=\"Recover deleted files using Mac Time Machine\" width=\"1920\" height=\"1200\" srcset=\"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/recover-deleted-files-via-time-machine.jpg 1920w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/recover-deleted-files-via-time-machine-300x188.jpg 300w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/recover-deleted-files-via-time-machine-500x313.jpg 500w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/recover-deleted-files-via-time-machine-768x480.jpg 768w, https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/recover-deleted-files-via-time-machine-1536x960.jpg 1536w\" sizes=\"(max-width: 1920px) 100vw, 1920px\" \/><\/li>\r\n\t<li>Select the files you want to restore and click <b>Restore<\/b>.<\/li>\r\n<\/ol>\r\n<div class=\"alert alert-info\" role=\"alert\">&#x1f4a1; <b>About local snapshots<\/b>: Modern versions of macOS automatically create local snapshots as part of the Time Machine feature, even when your backup disk isn&#8217;t connected. These <a href=\"https:\/\/support.apple.com\/en-us\/102154\" target=\"_blank\" rel=\"noopener noreferrer\">APFS snapshots<\/a> are stored on your startup disk and captured hourly for up to 24 hours, then maintained as daily snapshots until space is needed. Thanks to them, you might be able to recover recently deleted files even without an external backup drive.<\/div>\r\n<div class=\"alert alert-secondary\" role=\"alert\">&#x1f4dd; <b>Note<\/b>: For proactive protection beyond Time Machine, consider using Disk Drill&#8217;s <a href=\"\/help\/how-to-use-recovery-vault-and-guaranteed-recovery\">Recovery Vault<\/a> feature. Unlike Time Machine, which creates full backups, Recovery Vault keeps track of deleted files&#8217; metadata so it doesn&#8217;t consume any significant amount of storage space while still making it much easier to recover accidentally deleted files.<\/div>\r\n<h2 id=\"mistakes\"><span class=\"ez-toc-section\" id=\"common_mistakes_when_using_mac_terminal_for_recovery\"><\/span>Common Mistakes When Using Mac Terminal for Recovery<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p>The text-based nature of Terminal makes it easy for users to make seemingly small mistakes that have significant consequences (so large that they can be the difference between successful and failed recovery).<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"incorrect_paths\"><\/span>Incorrect Paths<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>The most frequent mistake is entering incorrect paths or commands. Terminal is unforgiving when it comes to typos, and even a single misplaced character will cause your command to fail. Here are some common path errors to avoid:<\/p>\r\n<ul>\r\n\t<li>Typing <kbd>cd.trash<\/kbd> instead of <kbd>cd .Trash<\/kbd> (missing the space)<\/li>\r\n\t<li>Using <kbd>cd trash<\/kbd> instead of <kbd>cd .Trash<\/kbd> (missing the period)<\/li>\r\n<\/ul>\r\n<h3><span class=\"ez-toc-section\" id=\"wrong_case\"><\/span>Wrong Case<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>While macOS typically uses a case-insensitive file system (APFS formatted as case-insensitive by default), Terminal commands themselves are case-sensitive. This creates a confusing situation where your file system might treat &#8220;Downloads&#8221; and &#8220;downloads&#8221; as the same folder, but Terminal commands require exact capitalization.<\/p>\r\n<p>For example, if you type <kbd>cd ~\/downloads<\/kbd> when the actual folder is named &#8220;Downloads&#8221; with a capital D, Terminal will still navigate to the folder because macOS&#8217;s file system is forgiving. But try typing <kbd>CD ~\/Downloads<\/kbd> (with uppercase CD), and Terminal will throw an error saying &#8220;command not found&#8221; &#8211; because the command itself must be lowercase.<\/p>\r\n<p>A <a href=\"https:\/\/www.reddit.com\/r\/MacOS\/comments\/1dw5fmh\/caseinsensitive_file_system_which_is_the_default\/\" target=\"_blank\" rel=\"noopener noreferrer\">Reddit user switching from Linux to macOS<\/a> discovered this quirk when extracting a tar file &#8211; their &#8220;downloads&#8221; directory seemed to vanish because macOS merged it with the existing &#8220;Downloads&#8221; folder. &#8220;I didn&#8217;t even know that there was such a thing as a case-insensitive file system,&#8221; they admitted.<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"incorrect_file_references\"><\/span>Incorrect File References<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>Terminal treats spaces as separators between different arguments, so a file named &#8220;My Important Document.pdf&#8221; looks like four separate items to Terminal unless you handle it properly.<\/p>\r\n<p><b>Wrong<\/b>: Users often type <kbd>mv My Important Document.pdf ..\/<\/kbd> expecting it to work, but Terminal interprets this as trying to move four different files: &#8220;My&#8221;, &#8220;Important&#8221;, &#8220;Document.pdf&#8221;, and &#8220;..\/&#8221;.<\/p>\r\n<p><b>Right<\/b>: The correct approach requires either wrapping the filename in quotes (<kbd>mv \"My Important Document.pdf\" ..\/<\/kbd>) or escaping each space with a backslash (<kbd>mv My\\ Important\\ Document.pdf ..\/<\/kbd>).<\/p>\r\n<h3><span class=\"ez-toc-section\" id=\"unrealistic_expectations\"><\/span>Unrealistic Expectations<span class=\"ez-toc-section-end\"><\/span><\/h3>\r\n<p>Sure, Terminal can move files out of your Trash folder, but that&#8217;s really about it. Once you&#8217;ve emptied the Trash, used the rm command, or experienced any real data loss, Terminal becomes useless.<\/p>\r\n<p>For serious data loss situations, you need proper data recovery software. Tools like Disk Drill exist because Terminal&#8217;s recovery abilities end where real data loss begins.<\/p>\r\n<div class=\"related_posts\"><div class=\"related_posts__inner\"><div class=\"h4\">Read also<\/div><div class=\"related_post\"><div class=\"related_post_item\"><div class=\"related_post_img\"><img src=\"\/howto\/wp-content\/uploads\/2020\/01\/apple.png\" alt=\"apple mac\" width=\"144\" height=\"144\" \/><\/div><div class=\"related_post_content\"><a target=\"_self\" href=\"\/howto\/recover-emptied-trash-mac.html\" class=\"related_post_link\">How to Recover Deleted Files on a Mac Without Software<\/a><\/div><\/div><\/div><div class=\"related_post\"><div class=\"related_post_item\"><div class=\"related_post_img\"><img src=\"\/howto\/wp-content\/uploads\/2020\/01\/Trash-Full-icon.png\" alt=\"Trash\" width=\"144\" height=\"144\" \/><\/div><div class=\"related_post_content\"><a target=\"_self\" href=\"\/mac-trash-recovery.html\" class=\"related_post_link\">Recover Deleted Files from an Emptied Trash on Mac<\/a><\/div><\/div><\/div><div class=\"related_post\"><div class=\"related_post_item\"><div class=\"related_post_img\"><img src=\"\/howto\/wp-content\/uploads\/2019\/06\/Deleted-Files-Search-Icon.png\" alt=\"Deleted Files\" width=\"256\" height=\"256\" \/><\/div><div class=\"related_post_content\"><a target=\"_self\" href=\"\/howto\/recover-overwritten-file-mac.html\" class=\"related_post_link\">Methods to Recover Replaced Files on Mac<\/a><\/div><\/div><\/div><div class=\"related_post\"><div class=\"related_post_item\"><div class=\"related_post_img\"><img src=\"\/howto\/wp-content\/uploads\/2020\/04\/windows.png\" alt=\"windows\" width=\"144\" height=\"144\" \/><\/div><div class=\"related_post_content\"><a target=\"_self\" href=\"\/recover-deleted-files.html\" class=\"related_post_link\">How to Recover Deleted Files on Windows<\/a><\/div><\/div><\/div><\/div><\/div>\r\n<h2><span class=\"ez-toc-section\" id=\"conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<p>We hope you&#8217;re now convinced that learning how to recover deleted files using Mac Terminal isn&#8217;t actually difficult. You just need to familiarize yourself with the basics and avoid <a href=\"#mistakes\">common mistakes<\/a> like incorrect paths or wrong case sensitivity. Unfortunately, there&#8217;s only so much Terminal can do.<\/p>\r\n<p>As explained throughout this article, once you&#8217;ve emptied the Trash or files bypassed it entirely, you&#8217;ll need specialized tools. Because there&#8217;s no shortage of options to choose from, you need to pick one that can meet your needs the best. For most Mac users, Disk Drill is an excellent choice thanks to its advanced data recovery capabilities combined with a user-friendly interface.<\/p>\r\n<p>If you would like to discover more recovery options beyond macOS recover deleted files Terminal methods, then you should check out this video showing 5 different ways to recover deleted files on Mac.<\/p>\r\n<div class=\"embed-responsive embed-responsive-16by9\">\r\n<iframe width=\"560\" height=\"315\" class=\"embed-responsive-item\" src=\"https:\/\/www.youtube.com\/embed\/N4NoX8mcWCQ\"  allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture\" allowfullscreen=\"\"><\/iframe>\r\n\r\n<\/div>\r\n<h2><span class=\"ez-toc-section\" id=\"faq\"><\/span>FAQ<span class=\"ez-toc-section-end\"><\/span><\/h2>\r\n<div><section itemscope=\"\" itemtype=\"https:\/\/schema.org\/FAQPage\">\r\n<div style=\"border-bottom: 00px solid rgb(213, 217, 217);\" class=\"panel panel-default faq-block\" itemprop=\"mainEntity\" itemscope=\"\" itemtype=\"http:\/\/schema.org\/Question\" role=\"tablist\">\r\n            <div class=\"panel-heading\" role=\"tab\" id=\"heading1\">\r\n                <div class=\"panel-title\" itemprop=\"name\">\r\n                    <a class=\"toggle-link transition-all collapsed\" role=\"button\" data-toggle=\"collapse\" href=\"#collapse-item-1\" aria-expanded=\"false\" aria-controls=\"collapse-item-1\"><h3 class=\"panel-title\"><span class=\"ez-toc-section\" id=\"if_i_deleted_a_file_using_rm_can_terminal_still_recover_it\"><\/span>If I deleted a file using rm, can Terminal still recover it?<span class=\"ez-toc-section-end\"><\/span><\/h3>                   \r\n                    \t<svg class=\"transition-all panel-toggle\" width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" xmlns:xlink=\"http:\/\/www.w3.org\/1999\/xlink\">\r\n                            <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n                                <path d=\"M7,7 L7,0 L9,0 L9,7 L16,7 L16,9 L9,9 L9,16 L7,16 L7,9 L0,9 L0,7 L7,7 Z\" fill=\"#000000\"><\/path>\r\n                            <\/g>\r\n                        <\/svg>\r\n                   <\/a>\r\n                <\/div>\r\n            <\/div>\r\n            <div id=\"collapse-item-1\" class=\"panel-collapse collapse\" role=\"tabpanel\" aria-labelledby=\"heading1\" aria-expanded=\"false\" style=\"\">\r\n              <div class=\"panel-body\" itemprop=\"acceptedAnswer\" itemscope=\"\" itemtype=\"http:\/\/schema.org\/Answer\">\r\n<div itemprop=\"text\">\r\n                <p>No, Terminal isn&#8217;t capable of recovering files deleted with the rm command. When you use rm, the file bypasses the Trash folder entirely and is immediately marked as deleted by the file system. Your only options are to use data recovery software like <b>Disk Drill<\/b> or <b>PhotoRec<\/b>, which can scan your disk for remnants of the deleted file, or restore from a <a href=\"#time-machine\">Time Machine backup<\/a> if you have one.<\/p>\r\n<\/div>\r\n                <div class=\"clearfix\"><\/div>\r\n              <\/div>\r\n            <\/div>\r\n<\/div>\r\n<div style=\"border-bottom: 00px solid rgb(213, 217, 217);\" class=\"panel panel-default faq-block\" itemprop=\"mainEntity\" itemscope=\"\" itemtype=\"http:\/\/schema.org\/Question\" role=\"tablist\">\r\n            <div class=\"panel-heading\" role=\"tab\" id=\"heading2\">\r\n                <div class=\"panel-title\" itemprop=\"name\">\r\n                    <a class=\"toggle-link transition-all collapsed\" role=\"button\" data-toggle=\"collapse\" href=\"#collapse-item-2\" aria-expanded=\"false\" aria-controls=\"collapse-item-2\"><h3 class=\"panel-title\">How do I recover a file from the Trash using Terminal if it's no longer visible there?<\/h3>                   \r\n                    \t<svg class=\"transition-all panel-toggle\" width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" xmlns:xlink=\"http:\/\/www.w3.org\/1999\/xlink\">\r\n                            <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n                                <path d=\"M7,7 L7,0 L9,0 L9,7 L16,7 L16,9 L9,9 L9,16 L7,16 L7,9 L0,9 L0,7 L7,7 Z\" fill=\"#000000\"><\/path>\r\n                            <\/g>\r\n                        <\/svg>\r\n                   <\/a>\r\n                <\/div>\r\n            <\/div>\r\n            <div id=\"collapse-item-2\" class=\"panel-collapse collapse\" role=\"tabpanel\" aria-labelledby=\"heading2\" aria-expanded=\"false\" style=\"\">\r\n              <div class=\"panel-body\" itemprop=\"acceptedAnswer\" itemscope=\"\" itemtype=\"http:\/\/schema.org\/Answer\">\r\n<div itemprop=\"text\">\r\n                <p>If a file isn&#8217;t visible in Trash through Finder but you suspect it&#8217;s still there, Terminal might help. Use the command <kbd>ls -al ~\/.Trash<\/kbd> to list all files in Trash, including hidden ones that Finder might not display. Sometimes files with special characters or system files don&#8217;t appear in the graphical Trash view. If Terminal shows the file, you can recover it using <kbd>mv ~\/.Trash\/filename ~\/Desktop\/<\/kbd> to move it to your Desktop. However, if Terminal also doesn&#8217;t show the file, it means the Trash has been emptied or the file bypassed it, and you&#8217;ll need <a href=\"#software\">data recovery software<\/a> to proceed.<\/p>\r\n<\/div>\r\n                <div class=\"clearfix\"><\/div>\r\n              <\/div>\r\n            <\/div>\r\n<\/div>\r\n<div style=\"border-bottom: 01px solid rgb(213, 217, 217);\" class=\"panel panel-default faq-block\" itemprop=\"mainEntity\" itemscope=\"\" itemtype=\"http:\/\/schema.org\/Question\" role=\"tablist\">\r\n            <div class=\"panel-heading\" role=\"tab\" id=\"heading3\">\r\n                <div class=\"panel-title\" itemprop=\"name\">\r\n                    <a class=\"toggle-link transition-all collapsed\" role=\"button\" data-toggle=\"collapse\" href=\"#collapse-item-3\" aria-expanded=\"false\" aria-controls=\"collapse-item-3\"><h3 class=\"panel-title\"><span class=\"ez-toc-section\" id=\"is_it_safe_to_use_terminal_to_recover_deleted_files\"><\/span>Is it safe to use Terminal to recover deleted files?<span class=\"ez-toc-section-end\"><\/span><\/h3>                   \r\n                    \t<svg class=\"transition-all panel-toggle\" width=\"16px\" height=\"16px\" viewBox=\"0 0 16 16\" version=\"1.1\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" xmlns:xlink=\"http:\/\/www.w3.org\/1999\/xlink\">\r\n                            <g stroke=\"none\" stroke-width=\"1\" fill=\"none\" fill-rule=\"evenodd\">\r\n                                <path d=\"M7,7 L7,0 L9,0 L9,7 L16,7 L16,9 L9,9 L9,16 L7,16 L7,9 L0,9 L0,7 L7,7 Z\" fill=\"#000000\"><\/path>\r\n                            <\/g>\r\n                        <\/svg>\r\n                   <\/a>\r\n                <\/div>\r\n            <\/div>\r\n            <div id=\"collapse-item-3\" class=\"panel-collapse collapse\" role=\"tabpanel\" aria-labelledby=\"heading3\" aria-expanded=\"false\" style=\"\">\r\n              <div class=\"panel-body\" itemprop=\"acceptedAnswer\" itemscope=\"\" itemtype=\"http:\/\/schema.org\/Answer\">\r\n<div itemprop=\"text\">\r\n                <p>Yes and no. If you follow the commands exactly as shown in this article, Terminal is perfectly safe for recovering files from the Trash. However, Terminal&#8217;s text-based nature makes it easy to make a mistake (a single typo can delete the wrong file, for example). For peace of mind, especially if you&#8217;re not comfortable with command-line interfaces, it might be better to use graphical data recovery software like <b>Disk Drill<\/b>.<\/p>\r\n<\/div>\r\n                <div class=\"clearfix\"><\/div>\r\n              <\/div>\r\n            <\/div>\r\n<\/div>\r\n<\/section><\/div>","protected":false},"excerpt":{"rendered":"So you&#8217;ve deleted a file on your Mac, and somewhere in your Googling, you stumbled upon mentions that it&#8217;s possible to recover permanently deleted files on Mac using Terminal. It&#8217;s true that Terminal can help restore deleted files, but only&#8230;","protected":false},"author":7868,"featured_media":33167,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2628],"tags":[],"class_list":{"0":"post-33159","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-recover-deleted-files-on-mac-os-x"},"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to Recover Deleted Files Using Mac Terminal [Solved]<\/title>\n<meta name=\"description\" content=\"Accidentally deleted a file on your Mac? Learn how to use Mac Terminal for file recovery and discover additional solutions for lost data.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.cleverfiles.com\/howto\/recover-deleted-files-using-mac-terminal.html\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Recover Deleted Files Using Mac Terminal [Solved]\" \/>\n<meta property=\"og:description\" content=\"Accidentally deleted a file on your Mac? Learn how to use Mac Terminal for file recovery and discover additional solutions for lost data.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.cleverfiles.com\/howto\/recover-deleted-files-using-mac-terminal.html\" \/>\n<meta property=\"og:site_name\" content=\"Data recovery tips. Recover deleted files on Mac, Windows.\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/move-file-from-trash-with-terminal.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1541\" \/>\n\t<meta property=\"og:image:height\" content=\"1121\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"David Morelo\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"How to Recover Deleted Files Using Mac Terminal [Solved]\" \/>\n<meta name=\"twitter:description\" content=\"Accidentally deleted a file on your Mac? Learn how to use Mac Terminal for file recovery and discover additional solutions for lost data.\" \/>\n<meta name=\"twitter:image\" content=\"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/move-file-from-trash-with-terminal.jpg\" \/>\n<meta name=\"twitter:creator\" content=\"@MoreloWrites\" \/>\n<meta name=\"twitter:site\" content=\"@Cleverfiles\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"David Morelo\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"11 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Recover Deleted Files Using Mac Terminal [Solved]","description":"Accidentally deleted a file on your Mac? Learn how to use Mac Terminal for file recovery and discover additional solutions for lost data.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.cleverfiles.com\/howto\/recover-deleted-files-using-mac-terminal.html","og_locale":"en_US","og_type":"article","og_title":"How to Recover Deleted Files Using Mac Terminal [Solved]","og_description":"Accidentally deleted a file on your Mac? Learn how to use Mac Terminal for file recovery and discover additional solutions for lost data.","og_url":"https:\/\/www.cleverfiles.com\/howto\/recover-deleted-files-using-mac-terminal.html","og_site_name":"Data recovery tips. Recover deleted files on Mac, Windows.","og_image":[{"width":1541,"height":1121,"url":"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/move-file-from-trash-with-terminal.jpg","type":"image\/jpeg"}],"author":"David Morelo","twitter_card":"summary_large_image","twitter_title":"How to Recover Deleted Files Using Mac Terminal [Solved]","twitter_description":"Accidentally deleted a file on your Mac? Learn how to use Mac Terminal for file recovery and discover additional solutions for lost data.","twitter_image":"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/move-file-from-trash-with-terminal.jpg","twitter_creator":"@MoreloWrites","twitter_site":"@Cleverfiles","twitter_misc":{"Written by":"David Morelo","Est. reading time":"11 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.cleverfiles.com\/howto\/recover-deleted-files-using-mac-terminal.html#article","isPartOf":{"@id":"https:\/\/www.cleverfiles.com\/howto\/recover-deleted-files-using-mac-terminal.html"},"author":{"name":"David Morelo","@id":"https:\/\/www.cleverfiles.com\/howto\/#\/schema\/person\/cb572c3c6f21975a615fae2d1c5ce0c4"},"headline":"How to Recover Deleted Files Using Mac Terminal","datePublished":"2021-02-19T12:03:07+00:00","dateModified":"2025-11-18T22:17:18+00:00","mainEntityOfPage":{"@id":"https:\/\/www.cleverfiles.com\/howto\/recover-deleted-files-using-mac-terminal.html"},"wordCount":2691,"publisher":{"@id":"https:\/\/www.cleverfiles.com\/howto\/#organization"},"image":{"@id":"https:\/\/www.cleverfiles.com\/howto\/recover-deleted-files-using-mac-terminal.html#primaryimage"},"thumbnailUrl":"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/move-file-from-trash-with-terminal.jpg","articleSection":["Recover Deleted Files on Mac OS X"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.cleverfiles.com\/howto\/recover-deleted-files-using-mac-terminal.html","url":"https:\/\/www.cleverfiles.com\/howto\/recover-deleted-files-using-mac-terminal.html","name":"How to Recover Deleted Files Using Mac Terminal [Solved]","isPartOf":{"@id":"https:\/\/www.cleverfiles.com\/howto\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.cleverfiles.com\/howto\/recover-deleted-files-using-mac-terminal.html#primaryimage"},"image":{"@id":"https:\/\/www.cleverfiles.com\/howto\/recover-deleted-files-using-mac-terminal.html#primaryimage"},"thumbnailUrl":"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/move-file-from-trash-with-terminal.jpg","datePublished":"2021-02-19T12:03:07+00:00","dateModified":"2025-11-18T22:17:18+00:00","description":"Accidentally deleted a file on your Mac? Learn how to use Mac Terminal for file recovery and discover additional solutions for lost data.","breadcrumb":{"@id":"https:\/\/www.cleverfiles.com\/howto\/recover-deleted-files-using-mac-terminal.html#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.cleverfiles.com\/howto\/recover-deleted-files-using-mac-terminal.html"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cleverfiles.com\/howto\/recover-deleted-files-using-mac-terminal.html#primaryimage","url":"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/move-file-from-trash-with-terminal.jpg","contentUrl":"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/01\/move-file-from-trash-with-terminal.jpg","width":1541,"height":1121,"caption":"recover rm files mac"},{"@type":"BreadcrumbList","@id":"https:\/\/www.cleverfiles.com\/howto\/recover-deleted-files-using-mac-terminal.html#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u0413\u043b\u0430\u0432\u043d\u0430\u044f","item":"https:\/\/www.cleverfiles.com\/howto\/fr\/"},{"@type":"ListItem","position":2,"name":"How to Recover Deleted Files Using Mac Terminal"}]},{"@type":"WebSite","@id":"https:\/\/www.cleverfiles.com\/howto\/#website","url":"https:\/\/www.cleverfiles.com\/howto\/","name":"Data recovery tips. Recover deleted files on Mac, Windows.","description":"","publisher":{"@id":"https:\/\/www.cleverfiles.com\/howto\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.cleverfiles.com\/howto\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.cleverfiles.com\/howto\/#organization","name":"CleverFiles","url":"https:\/\/www.cleverfiles.com\/howto\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cleverfiles.com\/howto\/#\/schema\/logo\/image\/","url":"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/07\/dd-mac-1024-flat.png","contentUrl":"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2021\/07\/dd-mac-1024-flat.png","width":512,"height":512,"caption":"CleverFiles"},"image":{"@id":"https:\/\/www.cleverfiles.com\/howto\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/Cleverfiles"]},{"@type":"Person","@id":"https:\/\/www.cleverfiles.com\/howto\/#\/schema\/person\/cb572c3c6f21975a615fae2d1c5ce0c4","name":"David Morelo","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.cleverfiles.com\/howto\/#\/schema\/person\/image\/","url":"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2020\/02\/web-fin-headshot-site-color-background-96x96.jpg","contentUrl":"https:\/\/www.cleverfiles.com\/howto\/wp-content\/uploads\/2020\/02\/web-fin-headshot-site-color-background-96x96.jpg","caption":"David Morelo"},"description":"David Morelo is a professional content writer focused on the technology sector, with expertise ranging from consumer products to the latest tech innovations. His approach involves personally testing each product according to strict editorial standards before writing detailed reviews, guides, and articles. David brings firsthand experience with Mac, Windows, and iOS platforms to his work. With over six years in the field, David\u2019s writing helps readers get the most out of their tech products. His content is straightforward, making complex topics easy to understand, even for non-technical users. As Content Team Lead at CleverFiles, he specializes in making data recovery topics accessible. Education: David Morelo holds a Bachelor's degree in English for Education. Outside of his professional life, he enjoys spending time with his family, biking, and sharing memorable moments with friends. Experience: David Morelo is a writer who shares his expertise on various reputable technology platforms. You can check out his portfolio at davidmorelo.com. He is also the author at Maketecheasier, where he delves into technical topics. You'll find his work at handyrecovery.com, where he shares his knowledge of data recovery. In addition, David writes at pandorarecovery.com, where he shares his knowledge in software testing.","sameAs":["davidmorelo","https:\/\/x.com\/MoreloWrites"],"url":"https:\/\/www.cleverfiles.com\/howto\/author\/david-morelo\/"}]}},"_links":{"self":[{"href":"https:\/\/www.cleverfiles.com\/howto\/wp-json\/wp\/v2\/posts\/33159","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cleverfiles.com\/howto\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cleverfiles.com\/howto\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cleverfiles.com\/howto\/wp-json\/wp\/v2\/users\/7868"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cleverfiles.com\/howto\/wp-json\/wp\/v2\/comments?post=33159"}],"version-history":[{"count":11,"href":"https:\/\/www.cleverfiles.com\/howto\/wp-json\/wp\/v2\/posts\/33159\/revisions"}],"predecessor-version":[{"id":56705,"href":"https:\/\/www.cleverfiles.com\/howto\/wp-json\/wp\/v2\/posts\/33159\/revisions\/56705"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.cleverfiles.com\/howto\/wp-json\/wp\/v2\/media\/33167"}],"wp:attachment":[{"href":"https:\/\/www.cleverfiles.com\/howto\/wp-json\/wp\/v2\/media?parent=33159"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cleverfiles.com\/howto\/wp-json\/wp\/v2\/categories?post=33159"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cleverfiles.com\/howto\/wp-json\/wp\/v2\/tags?post=33159"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}