07-28-2008
Can't remove a directory
Hello, somehow a directory called -r was created on one of my servers and I can't remove is using either rm or rmdir. Is there a way to remove this directory? Thank you.
-David
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
hi, i am on aix. i used smitty to remove a user..
but then found that its directory still exists....
so i have to remove the directory manually...
am i doing it the right way? (2 Replies)
Discussion started by: yls177
2 Replies
2. Programming
What is the best way to completely remove dir with it's content ???
rmdir deletes only EMPTY dirs as i know.
The man page of remove function says "remove() deletes a name from the file system." Can it remove any dir recursively ??? :rolleyes: (7 Replies)
Discussion started by: Trump
7 Replies
3. Shell Programming and Scripting
Hi,
I need to delete an empty directory in a temp directory except "dir5" (keep everything that is not empty).
Plese advise.
Here is an example of my directory.
/dir/temp/
dir1 - delete if this is empty
dir2 - delete if this is empty
dir3 - delete if this is empty
dir4 - delete if this... (7 Replies)
Discussion started by: sirrtuan
7 Replies
4. Shell Programming and Scripting
What's the best way to delete everything in a directory, but not the directory itself, without using shell wildcards? (9 Replies)
Discussion started by: pdc
9 Replies
5. Shell Programming and Scripting
I can remove blank lines at end of file using following code
for files in `ls * 2>/dev/null`
do
sed -e :a -e '/^\n*$/N;/\n$/ba' $files > newfile
mv newfile $files
done
How can I change above code, so that it recursively executes that code for all files under a directory? (6 Replies)
Discussion started by: ruchimca
6 Replies
6. UNIX for Advanced & Expert Users
Hi,
I want to remove a directory recursively except the inside directories calles .SYNC (designsync dirs) I am looking for something like:
\rm -rf < find . * | grep -v .SYNC
The find works ok but I do not know how to redirect it.
Please help.
Regards,
Ziv:rolleyes: (1 Reply)
Discussion started by: zivsegal
1 Replies
7. Shell Programming and Scripting
Hi,
I want to remove a directory recursively except the inside directories calles .SYNC (designsync dirs) I am looking for something like:
\rm -rf < find . * | grep -v .SYNC
The find works ok but I do not know how to redirect it.
Please help.
Regards,
Ziv (3 Replies)
Discussion started by: zivsegal
3 Replies
8. Shell Programming and Scripting
By Mistake i created a directory named "-lrt" in one of my working directories and now i am not able to delete it , please suggest hw to delete this directory now ?
Thanks in advance. (1 Reply)
Discussion started by: neeraj617
1 Replies
9. HP-UX
Hello my friends,
I have a directory called
log_old
when I try to delete it, it tells me no such file or directory.
Then I tried to run this command:
ls -lb
It tells me the directory name, it is: log_old1\177
!!
I tried to remove it using inode, using this... (4 Replies)
Discussion started by: Mohannad
4 Replies
10. UNIX for Dummies Questions & Answers
How to remove directory of a particular user (1 Reply)
Discussion started by: pspriyanka
1 Replies
RMDIR(1) User Commands RMDIR(1)
NAME
rmdir - remove empty directories
SYNOPSIS
rmdir [OPTION]... DIRECTORY...
DESCRIPTION
Remove the DIRECTORY(ies), if they are empty.
--ignore-fail-on-non-empty
ignore each failure that is solely because a directory
is non-empty
-p, --parents
remove DIRECTORY and its ancestors; e.g., `rmdir -p a/b/c' is similar to `rmdir a/b/c a/b a'
-v, --verbose
output a diagnostic for every directory processed
--help display this help and exit
--version
output version information and exit
AUTHOR
Written by David MacKenzie.
REPORTING BUGS
Report rmdir bugs to bug-coreutils@gnu.org
GNU coreutils home page: <http://www.gnu.org/software/coreutils/>
General help using GNU software: <http://www.gnu.org/gethelp/>
Report rmdir translation bugs to <http://translationproject.org/team/>
COPYRIGHT
Copyright (C) 2010 Free Software Foundation, Inc. License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>.
This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.
SEE ALSO
rmdir(2)
The full documentation for rmdir is maintained as a Texinfo manual. If the info and rmdir programs are properly installed at your site,
the command
info coreutils 'rmdir invocation'
should give you access to the complete manual.
GNU coreutils 8.5 February 2011 RMDIR(1)