About 128,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. bash - How to delete a directory that contains other subdirectories …

    Aug 31, 2014 · 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 …

  3. Delete files older than X days - Unix & Linux Stack Exchange

    Apr 7, 2015 · I have found the command to delete files older than 5 days in a folder find /path/to/files* -mtime +5 -exec rm {} \\; But how do I also do this for subdirectories in that folder?

  4. 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 …

  5. Check if directory exists and delete in one command

    Jan 30, 2011 · In bash, [ -d something ] checks if there is directory called 'something', returning a success code if it exists and is a directory. Chaining commands with && runs the second …

  6. 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 …

  7. linux - Efficiently delete large directory containing thousands of ...

    You should probably rename the question to something more accurate, like "Efficiently delete large directory containing thousands of files." In order to delete a directory and its contents, …

  8. What permissions are needed to delete a file in unix?

    Feb 11, 2019 · This directory contains two files (file1 & file2) I initially though that only write access was needed (on the directory) for me to be able to delete/remove a file via (rm …

  9. linux - Can't remove a directory in Unix - Stack Overflow

    Dec 23, 2017 · If the directory contains files or subdirectories, you'll need to use the -r flag with the rm command, like this: rm -r . Be cautious when using this command, as it will permanently …

  10. How to get over "device or resource busy"? - Unix & Linux Stack …

    The tool you want is lsof, which stands for list open files. It has a lot of options, so check the man page, but if you want to see all open files under a directory: lsof +D /path That will recurse …