About 330,000 results
Open links in new tab
  1. How do I remove a directory and all its contents? - Unix & Linux …

    In bash all I know is that rmdir directoryname will remove the directory but only if it's empty. Is there a way to force remove subdirectories?

  2. In Unix, how do you remove everything in the current directory …

    May 4, 2009 · That command deletes all the files and directories in the current directory and never prompts you to confirm you really want to do that. -f is particularly dangerous if you run the …

  3. bash - How to delete a directory that contains other subdirectories …

    Jul 16, 2023 · 3 I have a directory that contains files and other directories. I need to delete then all in one command, but without asking me for each file if I'm sure that i want to delete i; there is …

  4. How to remove files and directories quickly via terminal (bash shell)

    Apr 15, 2017 · When I use the rmdir command it only removes empty folders. If I have a directory nested with files and folders within folders with files and so on, is there a way to delete all the …

  5. How do I remove all sub-directories from within a directory?

    I have a directory that contains a bunch of sub-directories, .zip files, and other random files not contained within a sub-directory. I'd like a command line script to remove all sub-directories …

  6. linux - How to remove all the files in a directory? - Unix & Linux ...

    I am trying to remove all files and subdirectories in a directory. I used rm -r to remove all files, but I want to remove all files and subdirectories, excluding the top directory itself. For exam...

  7. How do I remove/delete/replace a folder that is not empty?

    Also note that even if the directory was empty, os.remove would fail again, because the correct function is os.rmdir .

  8. linux - Remove a symlink to a directory - Stack Overflow

    8 If rm cannot remove a symlink, perhaps you need to look at the permissions on the directory that contains the symlink. To remove directory entries, you need write permission on the …

  9. Remove all files except some from a directory - Stack Overflow

    Dec 1, 2010 · 44 find . | grep -v "excluded files criteria" | xargs rm This will list all files in current directory, then list all those that don't match your criteria (beware of it matching directory …

  10. What's the fastest way to remove all files & subfolders in a ... - linux

    Apr 18, 2016 · The above removes the files from your current directory in a fraction of a second, as it doesn't have to recursively handle the subdirectories. The actual removal of the tree from …