For the record: I was taking a class to on Linux/Unix commands and they showed us how to make directories with spaces and special characters. Here is the error I get when trying to remove the directory:
Code:
:/home/Hippie13>rmdir "my work"
rmdir: my work not removed.
No such file or directory
Thank you all again for your help.
Last edited by Nerdgirl1313; 03-09-2016 at 12:16 PM..
Reason: Add CODE tags.
Hi,
I accidentally deleted a big directory with all its sub-directories and bunch of source code files which I have been developing for about 2 years... What will I do now, how can I retrieve my files, directory hierarchy back ???
If anyone, please HELP ! ! ! ... (4 Replies)
Hello Gurus,
I want to delete only empty files (files with 0 bytes) at once from the local directory. Rightnow I need to go through all the files one by one manually and check the empty files before deleting them. Is there any unix command that finds and deletes empty files in a directory?... (5 Replies)
Hi Guys,
I want to know wheather it is possible to delete directory not files,
Example:
In one directory there are 10 dirs and 100 files but my req is to delete only dirs not file
Wheather it is possible ? (13 Replies)
I know someone will probably laugh at this question, I probably knew the answer many years ago when I was doing this full time but here goes.....
I have a directory that has many files and sub-directories in it, RMDIR will not delete a directory that is not empty so what is the command to... (1 Reply)
Hi all,
I'm trying to work on a script to delete files older then 31 day's in certain directories. Now, that works, but in one directory there are 3 other maps which contains files that can be deleted but one map which contains files that can't be deleted.
My current command is: find... (6 Replies)
Hi Folks,
I have a directory in unix that is /usr/local/pos contain the folowing directoreis ..that is
dir1
dir2
dir3
now I want to delete only dir2 please advise how to remove the directory dir 2 ..that is rm command and how to use it , and second if I want to zip the dir3 please... (1 Reply)
As i am working in unix environment so i have an logs that is created by my application at the following location that is
/opt/app/glac/current/servers/ops/logs
inside the logs directory there are different kinds of logs(that is the file having extension as .log ) have been created... (1 Reply)
I asked this question last month in Stack Exchange (linux - delete directory with leading hyphen - Server Fault) and none of the answers supplied worked.
I have somehow created a directory with a leading hyphen and cannot get rid of it.
# ls -li | grep p
2621441 drwxr-xr-x. 2 root root... (4 Replies)
Discussion started by: edstevens
4 Replies
LEARN ABOUT MOJAVE
rmdir
RMDIR(2) BSD System Calls Manual RMDIR(2)NAME
rmdir -- remove a directory file
SYNOPSIS
#include <unistd.h>
int
rmdir(const char *path);
DESCRIPTION
rmdir() removes a directory file whose name is given by path. The directory must not have any entries other than '.' and '..'.
RETURN VALUES
A 0 is returned if the remove succeeds; otherwise a -1 is returned and an error code is stored in the global location errno.
ERRORS
The named file is removed unless:
[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.
[EBUSY] The directory to be removed is the mount point for a mounted file system.
[EFAULT] Path points outside the process's allocated address space.
[EIO] An I/O error occurs while deleting the directory entry or deallocating the inode.
[ELOOP] Too many symbolic links are encountered in translating the pathname. This is taken to be indicative of a looping symbolic
link.
[ENAMETOOLONG] A component of a pathname (possibly expanded by a symbolic link) exceeds {NAME_MAX} characters, or an entire path name
exceeded {PATH_MAX} characters.
[ENOENT] The named directory does not exist.
[ENOTDIR] A component of the path is not a directory.
[ENOTEMPTY] The named directory contains files other than '.' and '..' in it.
[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.
[EROFS] The directory entry to be removed resides on a read-only file system.
SEE ALSO mkdir(2), unlink(2)HISTORY
The rmdir() function call appeared in 4.2BSD.
4.2 Berkeley Distribution June 4, 1993 4.2 Berkeley Distribution