About 50 results
Open links in new tab
  1. In Unix, how do you remove everything in the current directory and ...

    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 command …

  2. 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 files and …

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

    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 any command …

  4. Delete contents but not directory in Linux? - Stack Overflow

    May 7, 2017 · How do you delete all content of directory but not delete the directory itself in Linux command line terminal?

  5. linux - Remove all files in a directory (do not touch any folders or ...

    May 5, 2012 · find /direcname -maxdepth 1 -type f -delete and it is faster. Using -delete implies the -depth option, which means process directory contents before directory.

  6. Unix Command to Delete all files in a directory but preserve the ...

    Jul 11, 2012 · I am looking for a unix command to delete all files within a directory without deleting the directory itself. (note the directory does not contain subdirectories).

  7. Ansible: How to delete files and folders inside a directory?

    Jul 5, 2016 · The below code only deletes the first file it gets inside the web dir. I want to remove all the files and folders inside the web directory and retain the web directory. How can I do that? - name: r...

  8. How to remove folders with a certain name - Stack Overflow

    Oct 23, 2012 · In Linux, how do I remove folders with a certain name which are nested deep in a folder hierarchy? The following paths are under a folder and I would like to remove all folders named a.

  9. How to delete a directory and its contents in (POSIX) C?

    See man 2 unlink and man 2 rmdir for system calls that will delete files and (empty) directories respectively. All you need to do then in order to handle the recursive case is to traverse the target …

  10. Check if directory exists and delete in one command

    Jun 3, 2024 · 206 Is it possible to check if a directory exists and delete if it does, in Unix, using a single command? I have situation where I use Ant sshexec task where I can run only a single command in …