Deleting Huge Directories in Windows Via Command Prompt
Hi!
If you'd like to delete a huge folder / directory in Windows with maybe thousands or hundreds of thousands of files inside, doing that via Explorer might cost you a lot more time than via command prompt.
Here's how to do it faster:
- Open the command prompt by using "Start" => "cmd" and navigating to the desired path via "cd <path>" or "pushd <path>"
- OR -
navigate to the folder in the Explorer and use Shift + right-click and "Open command window here"
(Note: if deleting the desired folder requires elevated privileges, you will have to start a command prompt in elevated mode and navigate the old-fashioned way) - Use the following command:
rmdir /s /q folder
A little explanation about rmdir's flags:
- /s: removes the directory itself including all the contained files and subdirectories
- /q: forces deletion and does not ask for approval
Doing this can be very helpful in a coding environment where you can easily end up with thousands of small files.
Thanks for reading!
Source: https://stackoverflow.com/questions/186737/whats-the-fastest-way-to-delete-a-large-folder-in-windows
Share this:
- Click to share on X (Opens in new window) X
- Click to share on Facebook (Opens in new window) Facebook
- Click to share on Reddit (Opens in new window) Reddit
- More
- Click to share on LinkedIn (Opens in new window) LinkedIn
- Click to share on Tumblr (Opens in new window) Tumblr
- Click to share on Pinterest (Opens in new window) Pinterest
- Click to share on Pocket (Opens in new window) Pocket
- Click to share on Telegram (Opens in new window) Telegram
- Click to share on WhatsApp (Opens in new window) WhatsApp
Restoring Syntax Highlighting to Vim
Hi!
After doing a couple of updates on my servers today, I noticed that one of them had syntax highlighting in vim disabled. I double-checked to see that it was still vim that was installed, and not vi. Indeed it was, so I tried entering a couple of vim commands in order to re-enable syntax highlighting.
A couple of minutes of trying and searching the Internet went by till I got the idea to directly compare the vim version info both on one of my servers that had it working properly and the one that didn't. It turned out that even though it was the same version number and build with the same compile time it had a certain difference: one line said "Tiny version without GUI." vs. "Huge version without GUI.". The tiny version was the one that wasn't highlighting correctly.
So I checked out what the package manager thought of this:
# yum list *vim*
[...]
Installed Packages
vim-common.i386 2:7.0.109-7.el5 installed
vim-enhanced.i386 2:7.0.109-7.el5 installed
vim-minimal.i386 2:7.0.109-7.el5 installed
Available Packages
vim-X11.i386 2:7.0.109-7.el5 base
Somehow during updating it had apparently decided to install the vim-minimal package as well. And of course it wasn't installed on the server on which vim worked as it should.
Fair enough. I thought to myself that removing should fix it, but when I tried to it said the following:
# yum remove vim-minimal
Loaded plugins: fastestmirror
Setting up Remove Process
Resolving Dependencies
--> Running transaction check
---> Package vim-minimal.i386 2:7.0.109-7.el5 set to be erased
--> Processing Dependency: vim-minimal for package: sudo
--> Running transaction check
---> Package sudo.i386 0:1.7.2p1-13.el5 set to be erased
--> Finished Dependency Resolution
Dependencies Resolved
============================================================================================================
Package Arch Version Repository Size
============================================================================================================
Removing:
vim-minimal i386 2:7.0.109-7.el5 installed 581 k
Removing for dependencies:
sudo i386 1.7.2p1-13.el5 installed 861 k
Transaction Summary
============================================================================================================
Remove 2 Package(s)
Reinstall 0 Package(s)
Downgrade 0 Package(s)
Is this ok [y/N]:
That was weird. It felt the need to remove sudo along with it. Of course that was not okay for me, so I tried looking for a parameter for vim in order to ignore the dependencies, but apparently there are none (any more).
The solution I found after a couple of more minutes of searching the Internet was to remove the package via the actual rpm program. But don't you need the original rpm file for vim-minimal? No, you don't!
First you have to find out the complete package name, however. That can be done like this:
# rpm -qa | grep vim-minimal
vim-minimal-7.0.109-7.el5.i386
And finally just use the following command:
# rpm -e --nodeps vim-minimal-7.0.109-7.el5.i386
whereas the last parameter is of course the proper name of the package in question. --nodeps, as you might have figured already, stands for "no dependencies" and removes the package without any questions asked.
In the end, these simple steps restored the syntax highlighting functionality for my vim.
Let's hope that after the next update it doesn't decide to go monochrome again.
Thanks for reading!
Share this:
- Click to share on X (Opens in new window) X
- Click to share on Facebook (Opens in new window) Facebook
- Click to share on Reddit (Opens in new window) Reddit
- More
- Click to share on LinkedIn (Opens in new window) LinkedIn
- Click to share on Tumblr (Opens in new window) Tumblr
- Click to share on Pinterest (Opens in new window) Pinterest
- Click to share on Pocket (Opens in new window) Pocket
- Click to share on Telegram (Opens in new window) Telegram
- Click to share on WhatsApp (Opens in new window) WhatsApp
Calendar
| M | T | W | T | F | S | S |
|---|---|---|---|---|---|---|
| 1 | 2 | 3 | 4 | 5 | 6 | 7 |
| 8 | 9 | 10 | 11 | 12 | 13 | 14 |
| 15 | 16 | 17 | 18 | 19 | 20 | 21 |
| 22 | 23 | 24 | 25 | 26 | 27 | 28 |
| 29 | 30 | 31 | ||||
Recent Posts
- Windows Defender Firewall Inbound Rule for ICMPv6
- (Re)Setting Hyper-V Virtual Machine Client Zoom Level
- Uploading a Snapshot to a Fresh Home Assistant OS Instance
- Fix GNOME GUI Login After Upgrade to Debian 10 Buster (VirtualBox VM)
- Missing Credentials in Dropdown for Jenkins Build Configuration
Top Posts & Pages
- Windows Defender Firewall Inbound Rule for ICMPv6
- (Re)Setting Hyper-V Virtual Machine Client Zoom Level
- Firefox Lags + Sysinternals
- PDFCreator and mybrowserbar.com (Adware!)
- Memory Leaks / Problems with Long-Running Symfony / Doctrine Console Applications
- Getting a Let's Encrypt Certificate Through DNS Challenge With Cloudflare
- Fixing Low Stereo Out Sound Volume For the Yamaha MG12XU / MG16XU / MG20XU Audio Mixer
- Making Traceroutes Work with a Firewall (Windows)
Subscribe to Blog via E-mail
Categories
Archives
- May 2022
- April 2022
- May 2020
- July 2019
- June 2019
- October 2018
- May 2018
- January 2018
- December 2017
- October 2017
- September 2017
- August 2017
- March 2017
- February 2017
- January 2017
- December 2016
- June 2015
- November 2014
- December 2013
- July 2013
- May 2012
- April 2012
- March 2012
- January 2012
- June 2011
- May 2011
- June 2010
- April 2010
- January 2010
- October 2009
- September 2009
- August 2009
- July 2009
- June 2009