T
The Daily Insight

What is the command to delete a folder

Author

Ava Hall

Published May 17, 2026

To remove a directory and all its contents, including any subdirectories and files, use the rm command with the recursive option, -r . Directories that are removed with the rmdir command cannot be recovered, nor can directories and their contents removed with the rm -r command.

How do I delete a folder in CMD?

  1. To empty and remove a directory, type the following: rm mydir/* mydir/.* rmdir mydir. …
  2. To remove the /tmp/jones/demo/mydir directory and all the directories beneath it, type the following: cd /tmp rmdir -p jones/demo/mydir.

How do I delete a folder quickly?

  1. Tap on the Windows-key, type cmd.exe and select the result to load the command prompt.
  2. Navigate to the folder that you want to delete (with all its files and subfolders). …
  3. The command DEL /F/Q/S *. …
  4. Use cd.. to navigate to the parent folder afterwards.

What is the command of delete?

In computing, del (or erase ) is a command in command-line interpreters (shells) such as COMMAND.COM , cmd.exe , 4DOS, NDOS, 4OS2, 4NT and Windows PowerShell. It is used to delete one or more files or directories from a file system.

How do I delete a folder manually?

Delete key You can browse the location of the file or folder using My Computer or Windows Explorer. You can delete multiple files or folders by holding down the Ctrl key and clicking each file or folder before pressing Delete .

What does rm command do?

The rm command is used to delete files. … rm -r will recursively delete a directory and all its contents (normally rm will not delete directories, while rmdir will only delete empty directories).

How do you force delete a folder?

  1. Open the terminal application on Linux.
  2. The rmdir command removes empty directories only. Hence you need to use the rm command to remove files on Linux.
  3. Type the command rm -rf dirname to delete a directory forcefully.
  4. Verify it with the help of ls command on Linux.

How do I delete a folder and subfolders in CMD?

  1. Open Start on Windows 10.
  2. Search for Command Prompt, right-click the top result, and select the Run as administrator option.
  3. Type the following command to delete an empty folder and press Enter: rmdir PATH\TO\FOLDER-NAME.

What is Del * * In CMD?

To erase all the files in the current directory, enter. del *.* If you use this form of the command (to delete all files in a directory), the program will display the prompt.

How do you delete a file?
  1. Open a File Explorer window. Tip: A quick way to get to File Explorer is to press Windows Key. + E.
  2. Locate the file that you want to delete.
  3. Select the file and press your Delete key, or click Delete on the Home tab of the ribbon.
Article first time published on

How do I delete large folders?

Delete large folder fast using Command Prompt Open Start on Windows 10. Search for Command Prompt, right-click the top result, and select the Run as administrator option. In the command, make sure to update the path to the folder that you want to delete.

How do I delete a folder that is not empty in CMD?

To remove a directory that is not empty, use the rm command with the -r option for recursive deletion. Be very careful with this command, because using the rm -r command will delete not only everything in the named directory, but also everything in its subdirectories.

How do I force delete a folder in Windows 10?

  1. Open elevated Command Prompt in Windows 10.
  2. Type del + file path command, press Enter to force delete file.
  3. Type rmdir /s /q + folder directory, press Enter to force delete folder Windows 10.

How do you force delete a file?

To do this, start by opening the Start menu (Windows key), typing run , and hitting Enter. In the dialogue that appears, type cmd and hit Enter again. With the command prompt open, enter del /f filename , where filename is the name of the file or files (you can specify multiple files using commas) you want to delete.

How do I force delete a file in command prompt?

  1. Use “DEL” command to force delete a file in CMD: Access CMD utility. …
  2. Press Shift + Delete to force delete a file or folder. …
  3. Run Windows 10 in Safe Mode to Delete the File/Folder.

Why I cant delete a folder?

When you’re not allowed to delete a folder, a possible solution is just to restart your system. Another fix for this annoying issue is to use a third-party tool to solve the problem.

How do I delete Undeletable folder?

  1. Press “Ctrl + Alt + Delete” simultaneously and choose “Task Manager” to open it.
  2. Find the application where your data is in use. Select it and click “End task”.
  3. Try to delete the undeletable information once again.

How do I delete a file that Cannot be deleted?

  1. Go to Start, type Task Manager, and choose “Task Manager” to open it.
  2. Find the application that is currently using the file, and select “End task”.
  3. Then, try to delete the file again on your Windows PC.

What is remove RF?

What does rm -rf command do on a Unix-like operating system? The rm command removes each given FILE on the command line. By default, it does not remove directories. But, you can force it to remove directories too.

What does /* mean in Linux?

For example, the most commonly used special character is asterisk, * , meaning “zero or more characters“. When you type a command like ls a* , the shell finds all filenames in the current directory starting with a and passes them to the ls command.

What does CP do in Linux?

cp stands for copy. This command is used to copy files or group of files or directory. It creates an exact image of a file on a disk with different file name.

What is CLS command in DOS?

Command. In computing, CLS (for clear screen) is a command used by the command-line interpreters COMMAND.COM and cmd.exe on DOS, Digital Research FlexOS, IBM OS/2, Microsoft Windows and ReactOS operating systems to clear the screen or console window of commands and any output generated by them.

How do I delete a Windows folder?

Right-click the old Windows folder, and choose Properties. On the Permissions for Windows dialog that appears, you need to select SYSTEM and TrustedInstaller, and click the Remove button for each.

How do I delete a folder in Windows?

To remove a directory, just use the command rmdir <directory name> . Note: Any directories deleted with the rmdir command cannot be recovered.

How do I Delete a folder from my computer?

You just need to double-click a single file here — either the “Remove All Folders From This PC 64-bit. reg” file or the “Remove All Folders From This PC 32-bit. reg” file. This will remove all the folders from the This PC view.

How can I Delete files from my computer?

  1. Select the item you want to delete.
  2. Press and hold the Shift key, then press the Delete key on your keyboard.
  3. Because you cannot undo this, you will be asked to confirm that you want to delete the file or folder.

Is Shift Delete faster?

It was definitely the fastest way to go. Shift delete will be your safer way (you can see what you are highlighting and you get confirmation to delete), but it will take longer. Quickest way is a command line (or PS) (which there have been several good ones mentioned), but make darn sure you have your path right!