RMDIR(1) General Commands Manual RMDIR(1)NAME
rmdir, rm - remove (unlink) directories or files
rmdir dir ...
rm [ -f ] [ -r ] [ -i ] [ - ] file ...
Rmdir removes entries for the named directories, which must be empty.
Rm removes the entries for one or more files from a directory. If an entry was the last link to the file, the file is destroyed. Removal
of a file requires write permission in its directory, but neither read nor write permission on the file itself.
If a file has no write permission and the standard input is a terminal, its permissions are printed and a line is read from the standard
input. If that line begins with `y' the file is deleted, otherwise the file remains. No questions are asked and no errors are reported
when the -f (force) option is given.
If a designated file is a directory, an error comment is printed unless the optional argument -r has been used. In that case, rm recur-
sively deletes the entire contents of the specified directory, and the directory itself.
If the -i (interactive) option is in effect, rm asks whether to delete each file, and, under -r, whether to examine each directory.
The null option - indicates that all the arguments following it are to be treated as file names. This allows the specification of file
names starting with a minus.
SEE ALSO rm(1), unlink(2), rmdir(2)4.2 Berkeley Distribution April 29, 1985 RMDIR(1)
Check Out this Related Man Page
RMDIR(2) System Calls Manual RMDIR(2)NAME
rmdir - remove a directory file
int rmdir(const char *path)
Rmdir removes a directory file whose name is given by path. The directory must not have any entries other than "." and "..".
A 0 is returned if the remove succeeds; otherwise a -1 is returned and an error code is stored in the global location errno.
The named file is removed unless one or more of the following are true:
[ENOTDIR] A component of the path is not a directory.
[ENAMETOOLONG] The path name exceeds PATH_MAX characters.
[ENOENT] The named directory does not exist.
[ELOOP] Too many symbolic links were encountered in translating the pathname. (Minix-vmd)
[ENOTEMPTY] The named directory contains files other than ``.'' and ``..'' in it.
[EACCES] Search permission is denied for a component of the path prefix.
[EACCES] Write permission is denied on the directory containing the link to be removed.
[EPERM] The directory containing the directory to be removed is marked sticky, and neither the containing directory nor the direc-
tory to be removed are owned by the effective user ID.
[EBUSY] The directory to be removed is the mount point for a mounted file system.
[EIO] An I/O error occurred while deleting the directory entry or deallocating the inode.
[EROFS] The directory entry to be removed resides on a read-only file system.
[EFAULT] Path points outside the process's allocated address space.
SEE ALSO mkdir(2), unlink(2).
4.2 Berkeley Distribution August 26, 1985 RMDIR(2)
I am trying to remove a file so that I can delete a directory. Unfortuantely the file looks like this --------.--- and the system is not allowing me to remove the file. System message is
rm: Error: Illegal option -- -
usage: rm file...
I have tried rm * and rm *.* to no avail.
Any... (5 Replies)
Can anyone please help me: i'm trying to read a file with directory-names , then go to that directory and read another (output) file to perform some tasks per line (second read line in the part of script below).
The problem is that after the nested while loop has finished, the first while... (7 Replies)
Hi, Any command or means to delete a director which is not empty
rmdir or similar
iam using Sun Solaries 2.6 :confused:
I have many full directories with subdirectories and I can not go on emptying them all (5 Replies)
i need help to remove directory . The directory is not empty ., it contains
several sub directories and files inside that..
total number of files in one directory is 12,24,446 .
rm -rf doesnt work . it is prompting for every file ..
i want to delete without prompting and... (6 Replies)
If I wanted to do the following things to all the files in a directory how could I do it. Make all the files in a directory and in its sub directories to hidden status and make a different directory and all its sub directories copy inhibit. I am really stumped and have been looking through the... (8 Replies)
I have some files that appear to have no inode numbers. To complicate the matter, the filenames have UTF8 (I think) characters.
I am trying to delete them. In fact, and this might make things easier, I'm trying to delete their parent directory.
I don't know what to try next, please help.
... (5 Replies)
I need to delete an empty directory in a temp directory except "dir5" (keep everything that is not empty).
Here is an example of my directory.
dir1 - delete if this is empty
dir2 - delete if this is empty
dir3 - delete if this is empty
dir4 - delete if this... (7 Replies)
I have a directory, and there is a job running and constantly writes and removes files from and to this directory.
I would like to see somehow these changes without pressing `ls` every second. Kind of `tail -f` command, but for a directory list and not for file content.
I thought maybe kind... (5 Replies)
I have an 'empty' directory 'tmp' of which I am the owner and 777 permission. But when I try to delete the directory using rmdir or rm command, it gives error.
Command prompt snapshot:
... (4 Replies)
Hi , Need to shell script to extracts files names and write those to another file in different directory.
input file is
123 jggdy876... (9 Replies)
i need to get all files names on a c file directory to I can open every file and read from them to write on other files......
I solved the problem of reading and writing for a specific file to another file ....
but i want that for text files in .c file directory so how to read a names of... (5 Replies)
Oracle Linux 6.4
I am trying to remove the directory named OPatch. I am trying to run rm and rmdir commands while logged in as grid user, the owner of the directory.
But I keep getting "Permission denied" error. It is an empty directory. Any idea why I am getting 'Permission denied'... (5 Replies)