About 155,000 results
Open links in new tab
  1. How do I remove a directory and all its contents?

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

  3. rm - How to delete directories based on `find` output? - Unix

    Depending on your directory structure, you might be able to work around this with the --depth find option. In addition, if you have a directory structure like dirname/foo/dirname you will get "No …

  4. directory - Deleting folders in python recursively - Stack Overflow

    I'm having a problem with deleting empty directories. Here is my code: for dirpath, dirnames, filenames in os.walk(dir_to_search): # other codes try: os.rmdir(dirpath) except O...

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

    My typical solution is to rename or move the parent directory of the file, then come back later in a day or two and the file will have been removed automatically, at which point I am free to delete …

  6. How can I delete a file or folder in Python? - Stack Overflow

    On Python 3.3 and below, you can use these methods instead of the pathlib ones: os.remove() removes a file. os.unlink() removes a symbolic link. os.rmdir() removes an empty directory.

  7. How to remove mounted locations that have been added using …

    I have mounted the same location multiple times. How do I remove locations that show up from executing the mount command so that I can remove the incorrect ones I've mounted? The …

  8. linux - How do I tar a directory without retaining the directory ...

    tar -czf destination.tar.gz -C source/directory $(ls source/directory) This solution: Includes all files and folders in the directory Does not include any of the directory structure (or .) in the final …

  9. bash - How can I delete all files with a particular extension in a ...

    61 Yes, rm *.xvg will only delete the files with the specified extension in your current directory. A good way to make sure you are indeed in the directory you want delete your files is to use the …

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

    You need to use unlink() to remove files and other non-directories. You need to use rmdir() to remove (empty) directories. You would be better off using nftw() (rather than ftw()) since it …