Questions tagged [rmdir]

The `rmdir` command is a Linux, DOS and Windows command used to remove a directory or folder.

The rmdir command is a Linux and Windows command used to remove a directory or folder.

Manpage for rmdir.

152 questions
427
votes
4 answers

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

From a terminal window: When I use the rm command it can only remove files. 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…
None
306
votes
34 answers

Delete directory with files in it?

I wonder, what's the easiest way to delete a directory with all its files in it? I'm using rmdir(PATH . '/' . $value); to delete a folder, however, if there are files inside of it, I simply can't delete it.
matt
  • 42,713
  • 103
  • 264
  • 397
103
votes
4 answers

How do I remove an empty folder and push that change?

How can I remove an empty folder locally and also have that happen for other collaborators that share the remote via pull-push? I know that folders aren't 'tracked' in that sense by git but the question remains. e.g. I moved a file to another…
Michael Durrant
  • 93,410
  • 97
  • 333
  • 497
76
votes
5 answers

How to check existence of a folder with python and then remove it?

I want to remove dataset folder from dataset3 folder. But the following code is not removing dataset. First I want to check if dataset already exist in dataset then remove dataset. Can some one please point out my mistake in following code? for…
sara
  • 1,567
  • 4
  • 13
  • 21
52
votes
1 answer

Cannot delete a file even when logged in as an Administrator

Please could some tell me what I am doing wrong. I am trying to delete hidden folder through command line. I am running the command line as administrator but still getting message insufficient access. Here is screenshot of my command line : Here is…
user2061853
  • 627
  • 1
  • 7
  • 11
44
votes
8 answers

Finding empty directories in Python

All, What is the best way to check to see if there is data in a directory before deleting it? I am browsing through a couple pages to find some pics using wget and of course every page does not have an image on it but the directory is still created.…
aeupinhere
  • 2,883
  • 6
  • 31
  • 39
34
votes
9 answers

PHP: Unlink All Files Within A Directory, and then Deleting That Directory

Is there any way I can use RegExp or Wildcard searches to quickly delete all files within a folder, and then remove that folder in PHP, WITHOUT using the "exec" command? My server does not give me authorization to use that command. A simple loop of…
rolling_codes
  • 15,174
  • 22
  • 76
  • 112
7
votes
5 answers

Deleting directories using single liner command

How to remove more than one directory using single command? Is it possible to do it in one liner? If yes, Please help on this. /osmf/mgmt/scheduler>ls -lrt total 22 drwx------ 2 root root 12288 Mar 26 2009 lost+found drwxr-xr-x 4…
AruM
  • 242
  • 1
  • 3
  • 9
5
votes
0 answers

`os.rmdir` not working on empty directories?

Assume the following directory structure: A +-- B | +-- C | | +-- D | | | +-- E where no directory contains any files (not even invisible ones). Running os.rmdir("A/B/C/D/E"); os.rmdir("A/B/C/D"); os.rmdir("A/B/C"); os.rmdir("A/B");…
Cubi73
  • 1,891
  • 3
  • 31
  • 52
5
votes
6 answers

MY SQL - Error Code: 1010. Error dropping database (can't rmdir; errno: 13)

When trying to drop a database in MySQL 'DROP DATABASE IF EXISTS temporarydata' I am getting the following error Error Code: 1010. Error dropping database (can't rmdir '.\temporarydata', errno: 13) I have researched into this and I think it may…
user3244139
  • 65
  • 1
  • 1
  • 8
5
votes
3 answers

PHP mkdir - throwing error "File exists"

I am currently working through the Passbook section of iOS6 By Tutorials by the team at raywenderlich.com, and am getting the following errors in my PHP: Warning: mkdir() [function.mkdir]: File exists in /xxx/xxx/xxx/xxx/Pass.php on line…
Nick
  • 939
  • 1
  • 12
  • 19
4
votes
4 answers

Delete folder and all files on FTP connection

Trying to add the ability to delete a Folder using FTP and all subfolders and files contained within that folder. I have built a recursive function to do so, and I feel like the logic is right, but still doesnt work. I did some testing, I am able to…
JimmyJammed
  • 9,598
  • 19
  • 79
  • 146
4
votes
4 answers

Recursive delete

I have this code to recursive delete files and directories. It works fine but has a little problem. If $path = /var/www/foo/ it will delete everything inside of foo, but not foo. I want to delete foo directory too. Any idea? public function…
thom
  • 41
  • 1
  • 2
4
votes
0 answers

Electron Packager - Error: EPERM: operation not permitted, rmdir

I have a script in my package.json (I am on Win10) "build-win32": "electron-packager . --electron-version 1.4.15 --platform win32 --icon ./assets/icon.ico --out ./dist --overwrite" In command prompt I type npm run build-win32 I get the error:…
Rewind
  • 2,554
  • 3
  • 30
  • 56
4
votes
1 answer

Git in TFS - Branch switching - 'Could not rmdir ...'

I have recently convinced some of my colleagues to try out using Git instead of TFVC for a new team project, I've heard of some pros of DVCS world but rather than blindly switch over I want to assess if it provides any benefit to us. One (of many)…
aspirant_sensei
  • 1,568
  • 1
  • 16
  • 36
1
2 3
10 11